feat: 如果是zip文件则不加密下载

This commit is contained in:
2024-03-14 10:57:01 +08:00
parent dea2758de0
commit 5eeffe8d4b
2 changed files with 17 additions and 9 deletions
@@ -137,6 +137,13 @@ public class DownloadDecryptFileServiceImpl implements DownloadDecryptFileServic
// 下载文件 先解密,判断组织域,加密
try (InputStream is = IntekeyUtils.DecryptFile(decryptUrl, decryptAppCode, decryptSecretKey, null, file)) {
MultipartFile fileDecrypt = getMultipartFile(response,is, contentType, fileName);
// 判断fileDecrypt是不是zip压缩包,如果是压缩包的话则不加密
boolean isZipFile = false;
String originalFileName = fileDecrypt.getOriginalFilename();
if (originalFileName != null && originalFileName.endsWith(".zip")) {
isZipFile = true;
}
if (isZipFile) return;
int scope = getScope();
// 加密
encryptFile(response, fileDecrypt, scope);