mirror of
				https://github.com/dromara/RuoYi-Vue-Plus.git
				synced 2025-11-04 08:13:44 +08:00 
			
		
		
		
	fix 修复 管理员登出动态租户未清理导致二次无法登录
This commit is contained in:
		@@ -142,6 +142,10 @@ public class SysLoginService {
 | 
			
		||||
    public void logout() {
 | 
			
		||||
        try {
 | 
			
		||||
            LoginUser loginUser = LoginHelper.getLoginUser();
 | 
			
		||||
            if (TenantHelper.isEnable() && LoginHelper.isSuperAdmin()) {
 | 
			
		||||
                // 超级管理员 登出清除动态租户
 | 
			
		||||
                TenantHelper.clearDynamic();
 | 
			
		||||
            }
 | 
			
		||||
            StpUtil.logout();
 | 
			
		||||
            recordLogininfor(loginUser.getTenantId(), loginUser.getUsername(), Constants.LOGOUT, MessageUtils.message("user.logout.success"));
 | 
			
		||||
        } catch (NotLoginException ignored) {
 | 
			
		||||
 
 | 
			
		||||
@@ -76,7 +76,7 @@ public class UserActionListener implements SaTokenListener {
 | 
			
		||||
    @Override
 | 
			
		||||
    public void doKickout(String loginType, Object loginId, String tokenValue) {
 | 
			
		||||
        RedisUtils.deleteObject(CacheConstants.ONLINE_TOKEN_KEY + tokenValue);
 | 
			
		||||
        log.info("user doLogoutByLoginId, userId:{}, token:{}", loginId, tokenValue);
 | 
			
		||||
        log.info("user doKickout, userId:{}, token:{}", loginId, tokenValue);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user