fix 修复 管理员登出动态租户未清理导致二次无法登录

This commit is contained in:
疯狂的狮子li 2023-02-17 10:47:32 +08:00
parent 895e19768b
commit 2aabdb83ad
2 changed files with 5 additions and 1 deletions

View File

@ -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) {

View File

@ -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);
}
/**