修改系统登录时,权限验证的判断顺序调整

This commit is contained in:
Chuanjian Lai 2021-02-23 14:43:19 +08:00
parent 32a8f7effb
commit 6bc73bf4b7
1 changed files with 8 additions and 7 deletions

View File

@ -56,16 +56,17 @@ public class SysLoginService
// 查询用户信息 // 查询用户信息
R<LoginUser> userResult = remoteUserService.getUserInfo(username); R<LoginUser> userResult = remoteUserService.getUserInfo(username);
if (R.FAIL == userResult.getCode())
{
throw new BaseException(userResult.getMsg());
}
if (StringUtils.isNull(userResult) || StringUtils.isNull(userResult.getData())) if (StringUtils.isNull(userResult) || StringUtils.isNull(userResult.getData()))
{ {
remoteLogService.saveLogininfor(username, Constants.LOGIN_FAIL, "登录用户不存在"); remoteLogService.saveLogininfor(username, Constants.LOGIN_FAIL, "登录用户不存在");
throw new BaseException("登录用户:" + username + " 不存在"); throw new BaseException("登录用户:" + username + " 不存在");
} }
if (R.FAIL == userResult.getCode())
{
throw new BaseException(userResult.getMsg());
}
LoginUser userInfo = userResult.getData(); LoginUser userInfo = userResult.getData();
SysUser user = userResult.getData().getSysUser(); SysUser user = userResult.getData().getSysUser();
if (UserStatus.DELETED.getCode().equals(user.getDelFlag())) if (UserStatus.DELETED.getCode().equals(user.getDelFlag()))