系统退出删除用户缓存记录
This commit is contained in:
		
							parent
							
								
									9f97fd0953
								
							
						
					
					
						commit
						cef26e770e
					
				@ -43,6 +43,8 @@ public class LogoutSuccessHandlerImpl implements LogoutSuccessHandler
 | 
			
		||||
        if (StringUtils.isNotNull(loginUser))
 | 
			
		||||
        {
 | 
			
		||||
            String userName = loginUser.getUsername();
 | 
			
		||||
            // 删除用户缓存记录
 | 
			
		||||
            tokenService.delLoginUser(loginUser.getToken());
 | 
			
		||||
            // 记录用户退出日志
 | 
			
		||||
            AsyncManager.me().execute(AsyncFactory.recordLogininfor(userName, Constants.LOGOUT, "退出成功"));
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -82,6 +82,18 @@ public class TokenService
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 删除用户身份信息
 | 
			
		||||
     */
 | 
			
		||||
    public void delLoginUser(String token)
 | 
			
		||||
    {
 | 
			
		||||
        if (StringUtils.isNotEmpty(token))
 | 
			
		||||
        {
 | 
			
		||||
            String userKey = getTokenKey(token);
 | 
			
		||||
            redisCache.deleteObject(userKey);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 创建令牌
 | 
			
		||||
     * 
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user