修复反代前缀不能正常使用的bug;修复文件重命名之后分享码依旧存在的bug

This commit is contained in:
chuzhongzai 2024-05-01 22:37:29 +08:00
parent 246b1a2c26
commit 170841e458
2 changed files with 7 additions and 4 deletions

View File

@ -29,7 +29,7 @@ public class Site {
@JsonProperty("host")
public String getHost(){
if(reverseProxyPrefix != null)
return reverseProxyPrefix;
return "https://" + reverseProxyPrefix + "/";
else if(domain != null)
return "https://" + domain + "/";
else

View File

@ -628,11 +628,14 @@ public class FileService {
return response.failure("文件不存在").toJSONString();
File newFile = new File(file.getParentFile().getPath(), name);
if (file.renameTo(newFile))
if (file.renameTo(newFile)) {
response.success("重命名成功");
else
String shareCode = shareFileMapper.selectShareCodeByFilePath(file.getAbsolutePath());
shareFileMapper.deleteShareFile(shareCode);
shareFileMapper.deleteShareFileRecord(shareCode);
} else
response.failure("重命名失败");
}else {
} else {
FileOperateMessage rename = new FileOperateMessage();
rename.setPath(path);
rename.setName(name);