From f504a2800d510405b1269af502edcd41604b608d Mon Sep 17 00:00:00 2001 From: Charles7c Date: Mon, 16 Oct 2023 21:39:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E6=96=B9=E8=B4=A6=E5=8F=B7=E7=99=BB=E5=BD=95=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=BF=A1=E6=81=AF=E6=97=B6=EF=BC=8C=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E4=BA=BA=E5=AD=98=E5=9C=A8=E8=84=8F=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cnadmin/webapi/controller/auth/SocialAuthController.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/continew-admin-webapi/src/main/java/top/charles7c/cnadmin/webapi/controller/auth/SocialAuthController.java b/continew-admin-webapi/src/main/java/top/charles7c/cnadmin/webapi/controller/auth/SocialAuthController.java index 49819baf..084d4489 100644 --- a/continew-admin-webapi/src/main/java/top/charles7c/cnadmin/webapi/controller/auth/SocialAuthController.java +++ b/continew-admin-webapi/src/main/java/top/charles7c/cnadmin/webapi/controller/auth/SocialAuthController.java @@ -28,6 +28,7 @@ import org.springframework.web.bind.annotation.*; import com.xkcoding.justauth.AuthRequestFactory; import cn.dev33.satoken.annotation.SaIgnore; +import cn.dev33.satoken.stp.StpUtil; import top.charles7c.cnadmin.auth.model.vo.LoginVO; import top.charles7c.cnadmin.auth.service.LoginService; @@ -81,6 +82,9 @@ public class SocialAuthController { private AuthRequest getAuthRequest(String source) { try { + if (StpUtil.isLogin()) { + StpUtil.logout(); + } return authRequestFactory.get(source); } catch (Exception e) { throw new BadRequestException(String.format("暂不支持 [%s] 登录", source));