he2802 2 年之前
父节点
当前提交
4ccb57d358
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      zhongzheng-common/src/main/java/com/zhongzheng/common/utils/SecurityUtils.java

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

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