From 26830e19e8fcb552e85d7f35b5ffdb22db81c528 Mon Sep 17 00:00:00 2001 From: dinggang <2498628697@qq.com> Date: Wed, 27 Jul 2022 10:06:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=89=8D=E5=8F=B0=E9=80=80=E5=87=BA=E6=9C=AA?= =?UTF-8?q?=E6=B8=85=E9=99=A4=E5=90=8E=E5=8F=B0=E7=99=BB=E5=BD=95=E7=94=A8?= =?UTF-8?q?=E6=88=B7bugfix-1.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/security/controller/LoginController.java | 7 ++++++- .../security/service/impl/SysUserTokenServiceImpl.java | 1 - 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/security/controller/LoginController.java b/renren-admin/src/main/java/io/renren/modules/security/controller/LoginController.java index aa3d1d42..d3ff9709 100644 --- a/renren-admin/src/main/java/io/renren/modules/security/controller/LoginController.java +++ b/renren-admin/src/main/java/io/renren/modules/security/controller/LoginController.java @@ -14,7 +14,6 @@ import io.renren.modules.log.service.SysLogLoginService; import io.renren.modules.security.dto.LoginDTO; import io.renren.modules.security.oauth2.Oauth2Filter; 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.service.CaptchaService; 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.ApiOperation; import org.apache.commons.lang3.StringUtils; +import org.apache.shiro.subject.Subject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -45,6 +45,8 @@ import java.io.IOException; import java.util.Date; import java.util.Map; +import static org.apache.shiro.SecurityUtils.getSubject; + /** * 登录 */ @@ -188,6 +190,9 @@ public class LoginController { response.addHeader("REDIRECT", ssoValidator.getLogoutUrl()); } + Subject subject = getSubject(); + subject.logout(); + return new Result(); } diff --git a/renren-admin/src/main/java/io/renren/modules/security/service/impl/SysUserTokenServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/security/service/impl/SysUserTokenServiceImpl.java index 2571962c..306710ef 100644 --- a/renren-admin/src/main/java/io/renren/modules/security/service/impl/SysUserTokenServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/security/service/impl/SysUserTokenServiceImpl.java @@ -38,7 +38,6 @@ public class SysUserTokenServiceImpl extends BaseServiceImpl