Browse Source

设备模型修改8

master
caojianbin 2 years ago
parent
commit
731adca239
  1. 21
      ruoyi-common/ruoyi-common-security/src/main/java/com/ruoyi/common/security/utils/SecurityUtils.java

21
ruoyi-common/ruoyi-common-security/src/main/java/com/ruoyi/common/security/utils/SecurityUtils.java

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

Loading…
Cancel
Save