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