update 使用 satoken 自带的 BCrypt 工具 替换 Security 加密工具 减少依赖

This commit is contained in:
疯狂的狮子li
2022-02-11 15:03:09 +08:00
parent 04c36018d6
commit 61e2a07ee2
11 changed files with 34 additions and 72 deletions

View File

@ -118,4 +118,19 @@ public class LoginHelper {
return UserType.getUserType(loginId);
}
/**
* 是否为管理员
*
* @param userId 用户ID
* @return 结果
*/
public static boolean isAdmin(Long userId) {
return userId != null && 1L == userId;
}
public static boolean isAdmin() {
Long userId = getUserId();
return userId != null && 1L == userId;
}
}