From 7193ee08c95ebcaf0286a410b3e8906f8acde9b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Sun, 25 Jun 2023 22:20:27 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20satoken=20?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=20loginType=20=E5=88=86=E7=A6=BB=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/dromara/common/satoken/utils/LoginHelper.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ruoyi-common/ruoyi-common-satoken/src/main/java/org/dromara/common/satoken/utils/LoginHelper.java b/ruoyi-common/ruoyi-common-satoken/src/main/java/org/dromara/common/satoken/utils/LoginHelper.java index 7e8cabd6..bf04571b 100644 --- a/ruoyi-common/ruoyi-common-satoken/src/main/java/org/dromara/common/satoken/utils/LoginHelper.java +++ b/ruoyi-common/ruoyi-common-satoken/src/main/java/org/dromara/common/satoken/utils/LoginHelper.java @@ -68,9 +68,10 @@ public class LoginHelper { // } else if (userType == UserType.APP_USER) { // model.setTimeout(86400).setActiveTimeout(1800); // } - StpUtil.login(loginUser.getLoginId(), - model.setExtra(TENANT_KEY, loginUser.getTenantId()) - .setExtra(USER_KEY, loginUser.getUserId())); + StpUtil.stpLogic.setLoginType(loginUser.getUserType()) + .login(loginUser.getLoginId(), + model.setExtra(TENANT_KEY, loginUser.getTenantId()) + .setExtra(USER_KEY, loginUser.getUserId())); StpUtil.getTokenSession().set(LOGIN_USER_KEY, loginUser); } @@ -154,8 +155,8 @@ public class LoginHelper { * 获取用户类型 */ public static UserType getUserType() { - String loginId = StpUtil.getLoginIdAsString(); - return UserType.getUserType(loginId); + String loginType = StpUtil.stpLogic.getLoginType(); + return UserType.getUserType(loginType); } /**