deason 7 yıl önce
ebeveyn
işleme
60b3e8cff5

+ 8 - 0
examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/converter/PrintExamPaperService.java

@@ -50,6 +50,14 @@ public class PrintExamPaperService {
         if (oldPapers == null || oldPapers.size() == 0) {
             throw new IllegalArgumentException("Paper list size is empty.");
         }
+        if (StringUtils.isBlank(dirPath)) {
+            throw new IllegalArgumentException("dirPath must not be empty.");
+        }
+        if (StringUtils.isNotBlank(password)) {
+            if (!password.matches("^[0-9A-Za-z]{6,12}$")) {
+                throw new IllegalArgumentException("加密密码请输入6至12位的数字或字母!");
+            }
+        }
         log.info("exportPrintExamPaper start!");
         //提取题库试卷的数据
         List<PaperVo> papers = new ArrayList<>();