From 624fd877511d04a776e35a0198d2d416ce6ddfdb Mon Sep 17 00:00:00 2001
From: AprilWind <2100166581@qq.com>
Date: 星期四, 16 五月 2024 17:52:16 +0800
Subject: [PATCH] update 优化部门类别编码获取

---
 ruoyi-common/ruoyi-common-satoken/src/main/java/org/dromara/common/satoken/utils/LoginHelper.java |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 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 8e5af46..1e0d8a7 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
@@ -35,6 +35,7 @@
     public static final String USER_NAME_KEY = "userName";
     public static final String DEPT_KEY = "deptId";
     public static final String DEPT_NAME_KEY = "deptName";
+    public static final String DEPT_CATEGORY_KEY = "deptCategory";
     public static final String CLIENT_KEY = "clientid";
 
     /**
@@ -52,6 +53,7 @@
                 .setExtra(USER_NAME_KEY, loginUser.getUsername())
                 .setExtra(DEPT_KEY, loginUser.getDeptId())
                 .setExtra(DEPT_NAME_KEY, loginUser.getDeptName())
+                .setExtra(DEPT_CATEGORY_KEY, loginUser.getDeptCategory())
         );
         StpUtil.getTokenSession().set(LOGIN_USER_KEY, loginUser);
     }
@@ -100,6 +102,20 @@
     }
 
     /**
+     * 鑾峰彇閮ㄩ棬鍚�
+     */
+    public static String getDeptName() {
+        return Convert.toStr(getExtra(DEPT_NAME_KEY));
+    }
+
+    /**
+     * 鑾峰彇閮ㄩ棬绫诲埆缂栫爜
+     */
+    public static String getDeptCategory() {
+        return Convert.toStr(getExtra(DEPT_CATEGORY_KEY));
+    }
+
+    /**
      * 鑾峰彇褰撳墠 Token 鐨勬墿灞曚俊鎭�
      *
      * @param key 閿��

--
Gitblit v1.9.3