reset 回滚 错误优化导致问题

Signed-off-by: 疯狂的狮子Li <15040126243@163.com>
feature/model
疯狂的狮子Li 2 years ago committed by Gitee
parent dac463efa6
commit 9ebaf936c1
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

@ -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();
} }

Loading…
Cancel
Save