use of io.jpom.system.JpomRuntimeException in project Jpom by dromara.
the class CheckAuthorizeToken method check.
@PreLoadMethod
private static void check() {
String authorizeToken = ServerExtConfigBean.getInstance().getAuthorizeToken();
if (StrUtil.isEmpty(authorizeToken)) {
return;
}
if (authorizeToken.length() < 6) {
DefaultSystemLog.getLog().error("配置的授权token长度小于六位不生效", new JpomRuntimeException("配置的授权token长度小于六位不生效"));
System.exit(-1);
}
int strength = CheckPassword.checkPasswordStrength(authorizeToken);
if (strength != 2) {
DefaultSystemLog.getLog().error("配置的授权token 需要包含数字,字母,符号的组合", new JpomRuntimeException("配置的授权token 需要包含数字,字母,符号的组合"));
System.exit(-1);
}
}
Aggregations