判空修改

This commit is contained in:
sukang00 2021-07-29 03:32:01 +00:00 committed by Gitee
parent 892065003d
commit 5046d8a1ed
1 changed files with 6 additions and 5 deletions

View File

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