yangdamao 2 лет назад
Родитель
Сommit
36fcea4cdc

+ 2 - 1
zhongzheng-common/src/main/java/com/zhongzheng/common/utils/SecurityUtils.java

@@ -118,6 +118,7 @@ public class SecurityUtils
      */
     public static boolean isAdmin(Long userId)
     {
-        return userId != null && 1L == userId;
+        LoginUser user = (LoginUser) getAuthentication().getPrincipal();
+        return userId != null && "admin".equals(user.getUser().getUserName());
     }
 }