Commit 76f1f2fb by 许雪里 Committed by GitHub

Merge pull request #480 from uliian/master

添加配置参数校验
parents f4576a37 efd55f8f
...@@ -4,6 +4,8 @@ import org.springframework.beans.factory.InitializingBean; ...@@ -4,6 +4,8 @@ import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import javax.annotation.PostConstruct;
/** /**
* xxl-job config * xxl-job config
* *
...@@ -85,4 +87,14 @@ public class XxlJobAdminConfig implements InitializingBean{ ...@@ -85,4 +87,14 @@ public class XxlJobAdminConfig implements InitializingBean{
return i18n; return i18n;
} }
@PostConstruct
public void init() {
if(this.getLoginUsername().length()>18){
throw new IllegalArgumentException("username length greater than 18");
}
if(this.getLoginPassword().length()>18){
throw new IllegalArgumentException("password length greater than 18");
}
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment