优化代码。

This commit is contained in:
chenxudong 2025-08-12 16:53:24 +08:00
parent 6cfe0691d2
commit 5bf8e615e0
2 changed files with 3 additions and 3 deletions

View File

@ -299,7 +299,7 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
String fileSysPath = commonService.getFileSysPath(id);
String dbPath = commonService.getDbPath(fileInfo.getFilePath());
try {
Assert.isTrue(FileUtil.exist(fileSysPath), "下载文件不存在,路径为 {}", dbPath);
Assert.isTrue(FileUtil.exist(fileSysPath), "下载文件不存在");
FileSystemResource fileSystemResource = new FileSystemResource(fileSysPath);
fileName = fileSystemResource.getFilename();
HttpHeaders headers = new HttpHeaders();
@ -1351,7 +1351,7 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
} catch (Exception e) {
String info = StrFormatter.format("文件预览错误文件id是--->{},错误信息--->{}", id, e.getMessage());
log.error(info, e);
throw new BizException(info);
throw new BizException("文件预览错误文件id是 " + id);
} finally {
FileUtil.del(fileSaveTmpPath);
}

View File

@ -98,7 +98,7 @@ public final class EleCommonUtil {
aes.decrypt(inputStream, outputStream, true);
}
} catch (Exception e) {
String info = "文件加密失败";
String info = "文件加/解密失败";
log.error(info, e);
throw new BizException(info);
} finally {