xuhy
2024-08-16 b72c8ddb122eea2c58905268046652c4d4adafdc
ruoyi-common/ruoyi-common-security/src/main/java/com/ruoyi/common/security/service/TokenService.java
@@ -35,6 +35,7 @@
    protected static final long MILLIS_MINUTE = 60 * MILLIS_SECOND;
    private final static long expireTime = CacheConstants.EXPIRATION;
    private final static long expireAppletTime = CacheConstants.EXPIRATION_APPLET;
    private final static String ACCESS_TOKEN = CacheConstants.LOGIN_TOKEN_KEY;
@@ -71,7 +72,7 @@
     */
    public Map<String, Object> createTokenApplet(LoginUserApplet loginUser) {
        String token = IdUtils.fastUUID();
        Integer userId = loginUser.getUserid();
        Long userId = loginUser.getUserId();
        String name = loginUser.getName();
        loginUser.setToken(token);
        loginUser.setIpaddr(IpUtils.getIpAddr());
@@ -84,7 +85,7 @@
        // 接口返回信息
        Map<String, Object> rspMap = new HashMap<String, Object>();
        rspMap.put("access_token", JwtUtils.createToken(claimsMap));
        rspMap.put("expires_in", expireTime);
        rspMap.put("expires_in", expireAppletTime);
        return rspMap;
    }
    public LoginUserApplet getLoginUserApplet() {
@@ -104,8 +105,8 @@
        LoginUserApplet user = null;
        try {
            if (StringUtils.isNotEmpty(token)) {
                String userkey = JwtUtils.getUserKeyApplet(token);
                user = redisService.getCacheObject(getTokenKey(userkey));
                String userKey = JwtUtils.getUserKeyApplet(token);
                user = redisService.getCacheObject(getTokenKey(userKey));
                return user;
            }
        } catch (Exception e) {