From b4cbefd2b8abebd1c51b7a724e6a9b2a58b19e62 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: Thu, 10 Aug 2023 12:58:46 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E7=94=A8=E6=88=B7=E7=BC=93=E5=AD=98=20=E5=8E=BB?= =?UTF-8?q?=E9=99=A4=E5=86=97=E4=BD=99=E7=BB=9F=E4=B8=80=E5=AD=98=E5=82=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/dromara/common/satoken/utils/LoginHelper.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 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 22c160a7..2bbcd0d9 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 @@ -52,7 +52,7 @@ public class LoginHelper { StpUtil.login(loginUser.getLoginId(), model.setExtra(TENANT_KEY, loginUser.getTenantId()) .setExtra(USER_KEY, loginUser.getUserId())); - StpUtil.getTokenSession().set(LOGIN_USER_KEY, loginUser); + StpUtil.getSession().set(LOGIN_USER_KEY, loginUser); } /** @@ -63,7 +63,7 @@ public class LoginHelper { if (loginUser != null) { return loginUser; } - SaSession session = StpUtil.getTokenSession(); + SaSession session = StpUtil.getSession(); if (ObjectUtil.isNull(session)) { return null; } @@ -76,7 +76,8 @@ public class LoginHelper { * 获取用户基于token */ public static LoginUser getLoginUser(String token) { - SaSession session = StpUtil.getTokenSessionByToken(token); + Object loginId = StpUtil.getLoginIdByToken(token); + SaSession session = StpUtil.getSessionByLoginId(loginId); if (ObjectUtil.isNull(session)) { return null; }