1.static  + finall定义全局变量

package com.kexin.common.util;

public class Constants {

    /**
     * shiro采用加密算法
     */
    public static final String HASH_ALGORITHM = "SHA-1";

    /**
     * 生成Hash值的迭代次数
     */
    public static final int HASH_INTERATIONS = 1024;

    /**
     * 生成盐的长度
     */
    public static final int SALT_SIZE = 8;

    /**
     * 验证码
     */
    public static final String VALIDATE_CODE = "validateCode";

    /**
     *系统用户默认密码
     */
    public static final String DEFAULT_PASSWORD = "123456";
}

 2.调用

Constants.全局变量名

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-09
  • 2022-12-23
猜你喜欢
  • 2021-09-07
  • 2021-07-12
  • 2021-09-01
  • 2021-12-11
  • 2021-09-29
  • 2021-10-08
  • 2021-08-26
相关资源
相似解决方案