From 00b6ca5dfe5328444efca61afdff609228621ffd Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期二, 10 一月 2023 17:40:42 +0800
Subject: [PATCH] update springboot-admin 2.7.9 => 2.7.10 update easyexcel 3.1.4 => 3.1.5 update redisson 3.19.0 => 3.19.1

---
 ruoyi-common/src/main/java/com/ruoyi/common/helper/LoginHelper.java |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/helper/LoginHelper.java b/ruoyi-common/src/main/java/com/ruoyi/common/helper/LoginHelper.java
index 1cef027..05e370b 100644
--- a/ruoyi-common/src/main/java/com/ruoyi/common/helper/LoginHelper.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/helper/LoginHelper.java
@@ -81,12 +81,18 @@
         LoginUser loginUser = getLoginUser();
         if (ObjectUtil.isNull(loginUser)) {
             String loginId = StpUtil.getLoginIdAsString();
-            String[] strs = StringUtils.split(loginId, JOIN_CODE);
-            if (!ArrayUtil.containsAny(strs, UserType.values())) {
+            String userId = null;
+            for (UserType value : UserType.values()) {
+                if (StringUtils.contains(loginId, value.getUserType())) {
+                    String[] strs = StringUtils.split(loginId, JOIN_CODE);
+                    // 鐢ㄦ埛id鍦ㄦ�绘槸鍦ㄦ渶鍚�
+                    userId = strs[strs.length - 1];
+                }
+            }
+            if (StringUtils.isBlank(userId)) {
                 throw new UtilException("鐧诲綍鐢ㄦ埛: LoginId寮傚父 => " + loginId);
             }
-            // 鐢ㄦ埛id鍦ㄦ�绘槸鍦ㄦ渶鍚�
-            return Long.parseLong(strs[strs.length - 1]);
+            return Long.parseLong(userId);
         }
         return loginUser.getUserId();
     }

--
Gitblit v1.9.3