| | |
| | | return userInfo; |
| | | } |
| | | |
| | | public AppMiniLoginVO miniRegister(AppMiniRegisterDTO appUserRegisterDto) |
| | | { |
| | | // 查询用户信息 |
| | | R<AppMiniLoginVO> userResult = MemberClient.miniRegister(appUserRegisterDto); |
| | | if (R.FAIL == userResult.getCode()) |
| | | { |
| | | throw new ServiceException(userResult.getMsg()); |
| | | } |
| | | AppMiniLoginVO appMiniRegisterVo = userResult.getData(); |
| | | SysUser user=appMiniRegisterVo.getSysUser(); |
| | | if(appMiniRegisterVo.getSysUser()!=null){ |
| | | String username = user.getUserName(); |
| | | // IP黑名单校验 |
| | | String blackStr = Convert.toStr(redisService.getCacheObject(CacheConstants.SYS_LOGIN_BLACKIPLIST)); |
| | | if (IpUtils.isMatchedIp(blackStr, IpUtils.getIpAddr())) |
| | | { |
| | | recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "很遗憾,访问IP已被列入系统黑名单"); |
| | | throw new ServiceException("很遗憾,访问IP已被列入系统黑名单"); |
| | | } |
| | | if (UserStatus.DELETED.getCode().equals(user.getDelFlag())) |
| | | { |
| | | recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "对不起,您的账号已被删除"); |
| | | throw new ServiceException("对不起,您的账号: 已被删除"); |
| | | } |
| | | if (UserStatus.DISABLE.getCode().equals(user.getStatus())) |
| | | { |
| | | recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "用户已停用,请联系管理员"); |
| | | throw new ServiceException("对不起,您的账号: 已停用"); |
| | | } |
| | | recordLogService.recordLogininfor(username, Constants.LOGIN_SUCCESS, "登录成功"); |
| | | } |
| | | return appMiniRegisterVo; |
| | | } |
| | | |
| | | public AppMiniLoginVO actionMiniLogin(AppMiniLoginDTO appMiniLoginDto) |
| | | { |
| | | // 查询用户信息 |