Jelajahi Sumber

预览解密

wanghaiwu 2 minggu lalu
induk
melakukan
70eb31836e

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

@@ -297,19 +297,21 @@ public class FileSECUtils {
             InputStream tmpInputStream = new FileInputStream(tempFile);
 
             // 2. 调用是否加密接口方法
+            filepath = System.getProperty("java.io.tmpdir") + "/" + tempFile.getName();
+
             int isEncrypted = checkFileIsEncryptionRest(new FileInputStream(tempFile));
             if (isEncrypted == -1) {
                 logger.info("--------------SEC附件检查,文件加密状态检查失败----------------");
 
                 String tempPath = FileUtils.checkFileUrl(filepath);
-                FileTimeoutUtil.removeFile(tempPath, null, 10 * 1000); //  定时 120 秒后删除文件
+                FileTimeoutUtil.removeFile(tempPath, tmpInputStream, 120 * 1000); //  定时 120 秒后删除文件
 
                 return tmpInputStream;
             } else if (isEncrypted == 0) {
                 logger.info("--------------SEC附件检查,是明文无需解密----------------");
 
                 String tempPath = FileUtils.checkFileUrl(filepath);
-                FileTimeoutUtil.removeFile(tempPath, null, 10 * 1000); //  定时 120 秒后删除文件
+                FileTimeoutUtil.removeFile(tempPath, tmpInputStream, 120 * 1000); //  定时 120 秒后删除文件
 
                 return tmpInputStream;
             }