Browse Source

commit...

deason 5 years ago
parent
commit
3fdc002047

+ 4 - 4
examcloud-core-basic-base/src/main/java/cn/com/qmth/examcloud/core/basic/base/util/VerifyCode.java

@@ -44,7 +44,7 @@ public class VerifyCode {
         }
         }
 
 
         // 生成N条干扰线
         // 生成N条干扰线
-        for (int i = 0; i < 3; i++) {
+        for (int i = 0; i < 10; i++) {
             int x1 = random.nextInt(width);
             int x1 = random.nextInt(width);
             int y1 = random.nextInt(height);
             int y1 = random.nextInt(height);
             int x2 = random.nextInt(width);
             int x2 = random.nextInt(width);
@@ -62,8 +62,8 @@ public class VerifyCode {
                 .toString();
                 .toString();
 
 
         graphics.setColor(new Color(0, 0, 255));
         graphics.setColor(new Color(0, 0, 255));
-        graphics.setFont(new Font("宋体", Font.BOLD, 22));
-        graphics.drawString(verifyCode, 12, 28);
+        graphics.setFont(new Font("宋体", Font.BOLD, 26));
+        graphics.drawString(verifyCode, 12, 26);
         graphics.dispose();
         graphics.dispose();
 
 
         Integer result;
         Integer result;
@@ -130,7 +130,7 @@ public class VerifyCode {
         for (int n = 1; n <= 10; n++) {
         for (int n = 1; n <= 10; n++) {
             Result result = VerifyCode.generateVerifyCode();
             Result result = VerifyCode.generateVerifyCode();
 
 
-            final String imgPath = String.format("Img_%s.jpg", n);
+            final String imgPath = String.format("Img_%s_%s.jpg", n, result.getResult());
             File imgFile = new File(dir + "/" + imgPath);
             File imgFile = new File(dir + "/" + imgPath);
             ImageIO.write(result.getImage(), "JPEG", imgFile);
             ImageIO.write(result.getImage(), "JPEG", imgFile);
             System.out.println(imgPath + " \t\t " + result.getResult());
             System.out.println(imgPath + " \t\t " + result.getResult());

+ 1 - 1
examcloud-core-basic-starter/src/main/java/cn/com/qmth/examcloud/core/basic/starter/config/ScheduleConfig.java

@@ -22,7 +22,7 @@ public class ScheduleConfig implements Serializable {
      * 定时刷新登录规则(每N分钟执行)
      * 定时刷新登录规则(每N分钟执行)
      */
      */
     @PostConstruct
     @PostConstruct
-    @Scheduled(cron = "0 1/1 * * * ?")
+    @Scheduled(cron = "0 30/30 * * * ?")
     public void execute() {
     public void execute() {
         loginRuleService.refreshLoginRule();
         loginRuleService.refreshLoginRule();
     }
     }