fix: 修复获取用户id方法的判断,UserType枚举新增获取值的方法

This commit is contained in:
baymax 2023-01-08 15:43:22 +08:00
parent dac463efa6
commit 3a74f7d68e
2 changed files with 5 additions and 1 deletions

View File

@ -34,4 +34,8 @@ public enum UserType {
}
throw new RuntimeException("'UserType' not found By " + str);
}
public static String[] getUserTypeValue() {
return new String[]{SYS_USER.getUserType(), APP_USER.getUserType()};
}
}

View File

@ -82,7 +82,7 @@ public class LoginHelper {
if (ObjectUtil.isNull(loginUser)) {
String loginId = StpUtil.getLoginIdAsString();
String[] strs = StringUtils.split(loginId, JOIN_CODE);
if (!ArrayUtil.containsAny(strs, UserType.values())) {
if (!ArrayUtil.containsAny(strs, UserType.getUserTypeValue())) {
throw new UtilException("登录用户: LoginId异常 => " + loginId);
}
// 用户id在总是在最后