类 SystemUserCache

java.lang.Object
com.sh.common.util.Constant
com.sh.base.frame.common.SystemUserCache
所有已实现的接口:
Serializable

public class SystemUserCache extends Constant implements Serializable

Description: 登陆用户缓存

Title:首亨软件 - TSS/CRM等

从以下版本开始:
2015年4月30日
另请参阅:
  • 字段详细资料

    • log4j

      protected static org.apache.logging.log4j.Logger log4j
  • 方法详细资料

    • getInstance

      public static SystemUserCache getInstance()
    • checkLoginUser

      public void checkLoginUser(SHServletContext context, AuthServlet servlet, LoginBeforeCheckRet lbcr)
      servlet版本
      参数:
      context - SHServletContext
      servlet - AuthServlet
      lbcr - LoginBeforeCheckRet
    • checkMobileUser

      public boolean checkMobileUser(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, DataCenter dc, String userId, String password)
    • loginUser

      public UserInfo loginUser(DataCenter dc, String uid, String password)
      获取登陆用户
      参数:
      dc - DataCenter
      uid - String
      password - String
      返回:
      UserInfo
    • loginUser

      public UserInfo loginUser(DataCenter dc, String uid, String password, int tryCount)
    • getUserInfo

      public UserInfo getUserInfo(String userId)
    • isSM2Password

      public static boolean isSM2Password()
      判断是否使用SM2来进行密码加密
      返回:
      true|false
    • isSM4Password

      public static boolean isSM4Password()
      判断是否使用SM4来进行密码加密
      返回:
      true|false
    • isMD5Password

      public static boolean isMD5Password()
      判断是否使用MD5来进行密码加密
      返回:
      true|false
    • isBCryptPassword

      public static boolean isBCryptPassword()
      判断是否使用BCrypt来进行密码加密
      返回:
      true|false
    • refresh

      public List<UserInfo> refresh(DataCenter dc, String uid)
    • getCacheUserInfo2

      public static UserInfo getCacheUserInfo2(String userId)
      查询缓存用户,如果不存在,会做一次刷新缓存的操作
      参数:
      userId -
      返回:
    • getCacheUserInfo

      public static UserInfo getCacheUserInfo(String userId)
      获取缓存数据
      参数:
      userId - String
      返回:
      UserInfo
    • getCacheUserInfoAndNotExistsLoad

      public static UserInfo getCacheUserInfoAndNotExistsLoad(DataCenter dc, String userId)
      从缓存中加载用户信息,如果不存在,则刷新缓存
      参数:
      dc -
      userId -
      返回:
      UserInfo
    • refreshUser

      public static void refreshUser(DataCenter dc, String[] userIds)
    • refreshUser

      public static List<UserInfo> refreshUser(DataCenter dc, String userId)
      刷新用户缓存
      参数:
      dc -
      userId -
    • encryptSystemPwd

      public static String encryptSystemPwd(String value)
      生成加密字符串
      参数:
      value - 加密原文
      返回:
      适用于系统帐号密码加密后的密文
    • encryptSystemPwdIgnoreEncryptStr

      public static String encryptSystemPwdIgnoreEncryptStr(String value)
      生成加密字符串,如果是MD5/BCrypt加密,则返回原值,即已经是密方,不可反向加密的,直接返回
      参数:
      value - 加密原文
      返回:
      适用于系统帐号密码加密后的密文
    • decryptSystemPwd

      public static String decryptSystemPwd(String value)
      生成加密字符串源文
      参数:
      value - 密文
      返回:
      如果使用的是MD5,则直接返回
    • checkPassword

      public static boolean checkPassword(String password, String encryptPassword)
      检查密码是否有效
      参数:
      password - 密码,原文
      encryptPassword - 密文
      返回:
      boolean