Sfoglia il codice sorgente

3.4.5 20250625 成绩导出去掉密码

xiaofei 1 giorno fa
parent
commit
81ad0286cf

+ 3 - 3
teachcloud-common/src/main/java/com/qmth/teachcloud/common/util/FileUtil.java

@@ -623,9 +623,9 @@ public class FileUtil {
      * @param zipFileName      压缩zip文件路径+文件名
      */
     public static void downloadEncryptZip(HttpServletResponse response, File downloadPathFile, String zipFileName, String password) {
-        if (StringUtils.isBlank(password)) {
-            password = SystemConstant.ZIP_ENCRYPT_PWD;
-        }
+//        if (StringUtils.isBlank(password)) {
+//            password = SystemConstant.ZIP_ENCRYPT_PWD;
+//        }
         // 压缩zip文件和图片保存文件夹放在同一级
         File zipFile = new File(downloadPathFile.getParent(), zipFileName);
         try {

+ 1 - 1
teachcloud-common/src/main/java/com/qmth/teachcloud/common/util/Zip4jUtil.java

@@ -93,7 +93,7 @@ public class Zip4jUtil {
             throw ExceptionResultEnum.ERROR.exception("压缩文件必须为zip");
         }
         Optional.ofNullable(destPath).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("压缩路径不能为空"));
-        Optional.ofNullable(password).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("压缩密码不能为空"));
+//        Optional.ofNullable(password).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("压缩密码不能为空"));
         commonZipFile(scrPath, destPath, null, password);
     }
 

+ 2 - 2
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkStudentServiceImpl.java

@@ -1548,8 +1548,8 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
             log.debug("导出Excel结束");
 
             String zipFileName = downloadPathFile.getName() + SystemConstant.ZIP_PREFIX;
-            SysUser sysUser1 = sysUserService.getById(ServletUtil.getRequestUserId());
-            FileUtil.downloadEncryptZip(response, downloadPathFile, zipFileName, new String(Base64Util.decode(sysUser1.getPassword())));
+//            SysUser sysUser1 = sysUserService.getById(ServletUtil.getRequestUserId());
+            FileUtil.downloadEncryptZip(response, downloadPathFile, zipFileName, null);
         } catch (Exception e) {
             throw new RuntimeException(e);
         } finally {