Search in sources :

Example 16 with JpomRuntimeException

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);
    }
}
Also used : JpomRuntimeException(io.jpom.system.JpomRuntimeException) PreLoadMethod(cn.jiangzeyin.common.PreLoadMethod)

Aggregations

JpomRuntimeException (io.jpom.system.JpomRuntimeException)16 JSONObject (com.alibaba.fastjson.JSONObject)7 File (java.io.File)6 InputStream (java.io.InputStream)4 BetweenFormatter (cn.hutool.core.date.BetweenFormatter)2 DateUtil (cn.hutool.core.date.DateUtil)2 FileUtil (cn.hutool.core.io.FileUtil)2 LineHandler (cn.hutool.core.io.LineHandler)2 Tuple (cn.hutool.core.lang.Tuple)2 SecureUtil (cn.hutool.crypto.SecureUtil)2 Db (cn.hutool.db.Db)2 JsonMessage (cn.jiangzeyin.common.JsonMessage)2 JSON (com.alibaba.fastjson.JSON)2 AfterOpt (io.jpom.model.AfterOpt)2 NodeModel (io.jpom.model.data.NodeModel)2 JarFile (java.util.jar.JarFile)2 ZipFile (java.util.zip.ZipFile)2 JdbcSQLNonTransientException (org.h2.jdbc.JdbcSQLNonTransientException)2 CollUtil (cn.hutool.core.collection.CollUtil)1 Convert (cn.hutool.core.convert.Convert)1