浏览代码

Merge pull request #480 from uliian/master

许雪里 6 年前
父节点
当前提交
76f1f2fb8a
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 12 次插入0 次删除
  1. 12 0
      xxl-job-admin/src/main/java/com/xxl/job/admin/core/conf/XxlJobAdminConfig.java

+ 12 - 0
xxl-job-admin/src/main/java/com/xxl/job/admin/core/conf/XxlJobAdminConfig.java 查看文件

@@ -4,6 +4,8 @@ import org.springframework.beans.factory.InitializingBean;
4 4
 import org.springframework.beans.factory.annotation.Value;
5 5
 import org.springframework.context.annotation.Configuration;
6 6
 
7
+import javax.annotation.PostConstruct;
8
+
7 9
 /**
8 10
  * xxl-job config
9 11
  *
@@ -85,4 +87,14 @@ public class XxlJobAdminConfig implements InitializingBean{
85 87
         return i18n;
86 88
     }
87 89
 
90
+    @PostConstruct
91
+    public void init() {
92
+        if(this.getLoginUsername().length()>18){
93
+            throw new IllegalArgumentException("username length greater than 18");
94
+        }
95
+
96
+        if(this.getLoginPassword().length()>18){
97
+            throw new IllegalArgumentException("password length greater than 18");
98
+        }
99
+    }
88 100
 }