前台退出未清除后台登录用户bugfix-1.0

This commit is contained in:
dinggang 2022-07-27 10:06:31 +08:00
parent 559a1a4f55
commit 26830e19e8
2 changed files with 6 additions and 2 deletions

View File

@ -14,7 +14,6 @@ import io.renren.modules.log.service.SysLogLoginService;
import io.renren.modules.security.dto.LoginDTO; import io.renren.modules.security.dto.LoginDTO;
import io.renren.modules.security.oauth2.Oauth2Filter; import io.renren.modules.security.oauth2.Oauth2Filter;
import io.renren.modules.security.oauth2.SSOValidator; import io.renren.modules.security.oauth2.SSOValidator;
import io.renren.modules.security.oauth2.YaWeiCookieManage;
import io.renren.modules.security.password.PasswordUtils; import io.renren.modules.security.password.PasswordUtils;
import io.renren.modules.security.service.CaptchaService; import io.renren.modules.security.service.CaptchaService;
import io.renren.modules.security.service.SysUserTokenService; import io.renren.modules.security.service.SysUserTokenService;
@ -28,6 +27,7 @@ import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.subject.Subject;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -45,6 +45,8 @@ import java.io.IOException;
import java.util.Date; import java.util.Date;
import java.util.Map; import java.util.Map;
import static org.apache.shiro.SecurityUtils.getSubject;
/** /**
* 登录 * 登录
*/ */
@ -188,6 +190,9 @@ public class LoginController {
response.addHeader("REDIRECT", ssoValidator.getLogoutUrl()); response.addHeader("REDIRECT", ssoValidator.getLogoutUrl());
} }
Subject subject = getSubject();
subject.logout();
return new Result(); return new Result();
} }

View File

@ -38,7 +38,6 @@ public class SysUserTokenServiceImpl extends BaseServiceImpl<SysUserTokenDao, Sy
token = TokenGenerator.generateValue(); token = TokenGenerator.generateValue();
SysUserTokenEntity tokenEntity = new SysUserTokenEntity(); SysUserTokenEntity tokenEntity = new SysUserTokenEntity();
tokenEntity = new SysUserTokenEntity();
tokenEntity.setUserId(userId); tokenEntity.setUserId(userId);
tokenEntity.setToken(token); tokenEntity.setToken(token);
tokenEntity.setUpdateDate(now); tokenEntity.setUpdateDate(now);