【7.1.6】【file】放宽文件加密类型判断

pull/25/head
fengshuonan 2022-01-01 23:08:36 +08:00
parent 3583e83e43
commit 913b8cfebd
1 changed files with 8 additions and 4 deletions

View File

@ -188,9 +188,11 @@ public class SysFileInfoServiceImpl extends ServiceImpl<SysFileInfoMapper, SysFi
SysFileInfoResponse sysFileInfoResponse = this.getFileInfoResult(sysFileInfoRequest.getFileId());
// 如果文件加密等级不符合,文件不允许被访问
if (!sysFileInfoRequest.getSecretFlag().equals(sysFileInfoResponse.getSecretFlag())) {
if(YesOrNotEnum.Y.getCode().equals(sysFileInfoResponse.getSecretFlag())){
if(YesOrNotEnum.N.getCode().equals(sysFileInfoRequest.getSecretFlag())){
throw new FileException(FileExceptionEnum.FILE_DENIED_ACCESS);
}
}
DownloadUtil.download(sysFileInfoResponse.getFileOriginName(), sysFileInfoResponse.getFileBytes(), response);
}
@ -295,9 +297,11 @@ public class SysFileInfoServiceImpl extends ServiceImpl<SysFileInfoMapper, SysFi
SysFileInfoResponse sysFileInfoResponse = this.getFileInfoResult(sysFileInfoRequest.getFileId());
// 如果文件加密等级不符合,文件不允许被访问
if (!sysFileInfoRequest.getSecretFlag().equals(sysFileInfoResponse.getSecretFlag())) {
if(YesOrNotEnum.Y.getCode().equals(sysFileInfoResponse.getSecretFlag())){
if(YesOrNotEnum.N.getCode().equals(sysFileInfoRequest.getSecretFlag())){
throw new FileException(FileExceptionEnum.FILE_DENIED_ACCESS);
}
}
// 获取文件后缀
String fileSuffix = sysFileInfoResponse.getFileSuffix().toLowerCase();