From 8e89f95b9db4039f0cb8b4b8dc7974c247366c4c Mon Sep 17 00:00:00 2001
From: liyong <18434998025@163.com>
Date: 星期四, 21 五月 2026 15:14:46 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_天津_阳光彩印' into dev_天津_阳光彩印

---
 src/main/java/com/ruoyi/common/utils/SecurityUtils.java |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/main/java/com/ruoyi/common/utils/SecurityUtils.java b/src/main/java/com/ruoyi/common/utils/SecurityUtils.java
index 3caec60..97742ee 100644
--- a/src/main/java/com/ruoyi/common/utils/SecurityUtils.java
+++ b/src/main/java/com/ruoyi/common/utils/SecurityUtils.java
@@ -20,7 +20,6 @@
  */
 public class SecurityUtils
 {
-
     /**
      * 鐢ㄦ埛ID
      **/
@@ -39,11 +38,11 @@
     /**
      * 鑾峰彇閮ㄩ棬ID
      **/
-    public static Long getDeptId()
+    public static Long [] getDeptId()
     {
         try
         {
-            return getLoginUser().getDeptId();
+            return getLoginUser().getDeptIds();
         }
         catch (Exception e)
         {
@@ -122,7 +121,7 @@
      */
     public static boolean isAdmin(Long userId)
     {
-        return userId != null && 1L == userId;
+        return hasRole("鏅��2") ||hasRole("admin") || hasRole("鏈�楂�1");
     }
 
     /**
@@ -146,7 +145,7 @@
     public static boolean hasPermi(Collection<String> authorities, String permission)
     {
         return authorities.stream().filter(StringUtils::hasText)
-                .anyMatch(x -> Constants.ALL_PERMISSION.contains(x) || PatternMatchUtils.simpleMatch(x, permission));
+                .anyMatch(x -> Constants.ALL_PERMISSION.equals(x) || PatternMatchUtils.simpleMatch(x, permission));
     }
 
     /**
@@ -172,6 +171,6 @@
     public static boolean hasRole(Collection<String> roles, String role)
     {
         return roles.stream().filter(StringUtils::hasText)
-                .anyMatch(x -> Constants.SUPER_ADMIN.contains(x) || PatternMatchUtils.simpleMatch(x, role));
+                .anyMatch(x -> Constants.SUPER_ADMIN.equals(x) || PatternMatchUtils.simpleMatch(x, role));
     }
 }

--
Gitblit v1.9.3