From 61e2a07ee2709d6eb9144ec069ef7229bd8ee398 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期五, 11 二月 2022 15:03:09 +0800
Subject: [PATCH] update 使用 satoken 自带的 BCrypt 工具 替换 Security 加密工具 减少依赖

---
 ruoyi-common/src/main/java/com/ruoyi/common/helper/LoginHelper.java |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 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 aa18339..a152208 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
@@ -118,4 +118,19 @@
         return UserType.getUserType(loginId);
     }
 
+    /**
+     * 鏄惁涓虹鐞嗗憳
+     *
+     * @param userId 鐢ㄦ埛ID
+     * @return 缁撴灉
+     */
+    public static boolean isAdmin(Long userId) {
+        return userId != null && 1L == userId;
+    }
+
+    public static boolean isAdmin() {
+        Long userId = getUserId();
+        return userId != null && 1L == userId;
+    }
+
 }

--
Gitblit v1.9.3