From c9a9da7f4917e0094a5b1bb4017601ef307cd5bd Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期四, 12 八月 2021 11:38:06 +0800
Subject: [PATCH] remove 移除无用配置

---
 ruoyi-common/src/main/java/com/ruoyi/common/utils/SecurityUtils.java |   34 ++++++++++++++++++++++++++++++++--
 1 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/SecurityUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/SecurityUtils.java
index bdcc9eb..1616442 100644
--- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/SecurityUtils.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/SecurityUtils.java
@@ -9,11 +9,41 @@
 
 /**
  * 瀹夊叏鏈嶅姟宸ュ叿绫�
- * 
+ *
  * @author ruoyi
  */
 public class SecurityUtils
 {
+    /**
+     * 鐢ㄦ埛ID
+     **/
+    public static Long getUserId()
+    {
+        try
+        {
+            return getLoginUser().getUserId();
+        }
+        catch (Exception e)
+        {
+            throw new CustomException("鑾峰彇鐢ㄦ埛ID寮傚父", HttpStatus.HTTP_UNAUTHORIZED);
+        }
+    }
+
+    /**
+     * 鑾峰彇閮ㄩ棬ID
+     **/
+    public static Long getDeptId()
+    {
+        try
+        {
+            return getLoginUser().getDeptId();
+        }
+        catch (Exception e)
+        {
+            throw new CustomException("鑾峰彇閮ㄩ棬ID寮傚父", HttpStatus.HTTP_UNAUTHORIZED);
+        }
+    }
+
     /**
      * 鑾峰彇鐢ㄦ埛璐︽埛
      **/
@@ -79,7 +109,7 @@
 
     /**
      * 鏄惁涓虹鐞嗗憳
-     * 
+     *
      * @param userId 鐢ㄦ埛ID
      * @return 缁撴灉
      */

--
Gitblit v1.9.3