优化代码。
This commit is contained in:
parent
6cfe0691d2
commit
5bf8e615e0
|
|
@ -299,7 +299,7 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
||||||
String fileSysPath = commonService.getFileSysPath(id);
|
String fileSysPath = commonService.getFileSysPath(id);
|
||||||
String dbPath = commonService.getDbPath(fileInfo.getFilePath());
|
String dbPath = commonService.getDbPath(fileInfo.getFilePath());
|
||||||
try {
|
try {
|
||||||
Assert.isTrue(FileUtil.exist(fileSysPath), "下载文件不存在,路径为 {}", dbPath);
|
Assert.isTrue(FileUtil.exist(fileSysPath), "下载文件不存在");
|
||||||
FileSystemResource fileSystemResource = new FileSystemResource(fileSysPath);
|
FileSystemResource fileSystemResource = new FileSystemResource(fileSysPath);
|
||||||
fileName = fileSystemResource.getFilename();
|
fileName = fileSystemResource.getFilename();
|
||||||
HttpHeaders headers = new HttpHeaders();
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
|
@ -1351,7 +1351,7 @@ public class EdFileInfoServiceImpl extends ServiceImpl<EdFileInfoMapper, EdFileI
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
String info = StrFormatter.format("文件预览错误,文件id是--->{},错误信息--->{}", id, e.getMessage());
|
String info = StrFormatter.format("文件预览错误,文件id是--->{},错误信息--->{}", id, e.getMessage());
|
||||||
log.error(info, e);
|
log.error(info, e);
|
||||||
throw new BizException(info);
|
throw new BizException("文件预览错误,文件id是 " + id);
|
||||||
} finally {
|
} finally {
|
||||||
FileUtil.del(fileSaveTmpPath);
|
FileUtil.del(fileSaveTmpPath);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ public final class EleCommonUtil {
|
||||||
aes.decrypt(inputStream, outputStream, true);
|
aes.decrypt(inputStream, outputStream, true);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
String info = "文件加密失败";
|
String info = "文件加/解密失败";
|
||||||
log.error(info, e);
|
log.error(info, e);
|
||||||
throw new BizException(info);
|
throw new BizException(info);
|
||||||
} finally {
|
} finally {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue