Kaynağa Gözat

submit:新机构后台账号

yangdamao 2 yıl önce
ebeveyn
işleme
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());
     }
 }