yangdamao 2 년 전
부모
커밋
81d38d5c5f
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;
     }
 }