Bladeren bron

增加文件加密1

turborao 1 week geleden
bovenliggende
commit
a8b3bf5f76

+ 3 - 3
code/base/nckd-jimin-base-helper/src/main/java/nckd/base/helper/FileSECUtils.java

@@ -244,8 +244,8 @@ public class FileSECUtils {
             // 4. 调用加密方法
             InputStream encodeInputStream = encodeFileForSEC(fileSize, new FileInputStream(tempFile));
             if (encodeInputStream == null) {
-                logger.info("--------------SEC附件加密,文件密失败----------------");
-                return null;
+                logger.info("--------------SEC附件加密,文件密失败----------------");
+                return tmpInputStream;
             }
 
             // 5. 删除临时文件
@@ -318,7 +318,7 @@ public class FileSECUtils {
             InputStream decryptedInputStream = decodeFileForSEC(fileSize, new FileInputStream(tempFile));
             if (decryptedInputStream == null) {
                 logger.info("--------------SEC附件解密,文件解密失败----------------");
-                return null;
+                return tmpInputStream;
             }
 
             // 5. 删除临时文件