| | |
| | | throw new CaptchaException("验证码错误"); |
| | | } |
| | | } |
| | | remoteCompanyUserService.registerUser(registerUser, SecurityConstants.INNER); |
| | | R<Boolean> booleanR = remoteCompanyUserService.registerUser(registerUser, SecurityConstants.INNER); |
| | | if (R.isError(booleanR)){ |
| | | throw new ServiceException("注册失败"); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | String accountName = registerUser.getAccountName(); |
| | | String password = registerUser.getPassword(); |
| | | |
| | | R<User> userByPhoneR = remoteCompanyUserService.getUserByPhone(accountName, SecurityConstants.INNER); |
| | | if (R.isError(userByPhoneR)){ |
| | | throw new ServiceException(userByPhoneR.getMsg()); |
| | | } |
| | | if (userByPhoneR.getData() == null){ |
| | | throw new ServiceException("账号不存在"); |
| | | } |
| | | |
| | | if (SecurityUtils.matchesPassword(password, userByPhoneR.getData().getPassword())){ |
| | | return userByPhoneR.getData(); |
| | | } |
| | | |
| | | |
| | | R<User> r = remoteCompanyUserService.getUserByAccountName(accountName, SecurityConstants.INNER); |
| | | if (R.isError(r)){ |
| | | throw new ServiceException(r.getMsg()); |
| | |
| | | if (r.getData() == null){ |
| | | throw new ServiceException("账号不存在"); |
| | | } |
| | | if (!SecurityUtils.matchesPassword(r.getData().getPassword(), password)){ |
| | | if (!SecurityUtils.matchesPassword(password, r.getData().getPassword())){ |
| | | throw new ServiceException("密码错误"); |
| | | } |
| | | return r.getData(); |