|
|
@ -25,6 +25,15 @@ public class SecurityUtils |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
|
|
|
|
* yisai获取用户ID |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public static String getStringUserId() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return SecurityContextHolder.getStringUserId(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 获取用户名称 |
|
|
|
* 获取用户名称 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static String getUsername() |
|
|
|
public static String getUsername() |
|
|
@ -90,6 +99,18 @@ public class SecurityUtils |
|
|
|
return userId != null && 1L == userId; |
|
|
|
return userId != null && 1L == userId; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* yisai是否为管理员 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param userId 用户ID |
|
|
|
|
|
|
|
* @return 结果 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public static boolean isAdminString(String userId) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return userId != null && "1".equals(userId); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 生成BCryptPasswordEncoder密码 |
|
|
|
* 生成BCryptPasswordEncoder密码 |
|
|
|
* |
|
|
|
* |
|
|
|