|
|
@ -81,12 +81,18 @@ public class LoginHelper {
|
|
|
|
LoginUser loginUser = getLoginUser();
|
|
|
|
LoginUser loginUser = getLoginUser();
|
|
|
|
if (ObjectUtil.isNull(loginUser)) {
|
|
|
|
if (ObjectUtil.isNull(loginUser)) {
|
|
|
|
String loginId = StpUtil.getLoginIdAsString();
|
|
|
|
String loginId = StpUtil.getLoginIdAsString();
|
|
|
|
String[] strs = StringUtils.split(loginId, JOIN_CODE);
|
|
|
|
String userId = null;
|
|
|
|
if (!ArrayUtil.containsAny(strs, UserType.values())) {
|
|
|
|
for (UserType value : UserType.values()) {
|
|
|
|
|
|
|
|
if (StringUtils.contains(loginId, value.getUserType())) {
|
|
|
|
|
|
|
|
String[] strs = StringUtils.split(loginId, JOIN_CODE);
|
|
|
|
|
|
|
|
// 用户id在总是在最后
|
|
|
|
|
|
|
|
userId = strs[strs.length - 1];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(userId)) {
|
|
|
|
throw new UtilException("登录用户: LoginId异常 => " + loginId);
|
|
|
|
throw new UtilException("登录用户: LoginId异常 => " + loginId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 用户id在总是在最后
|
|
|
|
return Long.parseLong(userId);
|
|
|
|
return Long.parseLong(strs[strs.length - 1]);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return loginUser.getUserId();
|
|
|
|
return loginUser.getUserId();
|
|
|
|
}
|
|
|
|
}
|
|
|
|