| | |
| | | party = this.partyService.save(party); |
| | | |
| | | if (type.equals("1")) { |
| | | // 手机注册 |
| | | // 手机注册 |
| | | if (StringUtils.isEmptyString(reg.getUsername()) || reg.getUsername().length() > 20) { |
| | | throw new BusinessException("请输入正确的手机号码"); |
| | | } |
| | |
| | | party.setSafeword(this.passwordEncoder.encodePassword(reg.getSafeword(), SaltSigureUtils.saltfigure)); |
| | | party.setRolename(Constants.SECURITY_ROLE_MEMBER); |
| | | |
| | | if (type.equals("1")) { |
| | | // 手机注册 |
| | | if (StringUtils.isEmptyString(reg.getUsername()) || reg.getUsername().length() > 20) { |
| | | throw new BusinessException("请输入正确的手机号码"); |
| | | } |
| | | party.setPhone(reg.getUsername()); |
| | | party.setPhone_authority(false); |
| | | } else if (type.equals("2")) { |
| | | // 邮箱注册 |
| | | if (!Strings.isEmail(reg.getUsername())) { |
| | | throw new BusinessException("请输入正确的邮箱地址"); |
| | | } |
| | | party.setEmail(reg.getUsername()); |
| | | party.setEmail_authority(false); |
| | | } else { |
| | | // 用户名注册 |
| | | if (reg.getUsername().length() < 6 || reg.getUsername().length() > 30) { |
| | | throw new BusinessException("用户名必须6-30位"); |
| | | } |
| | | } |
| | | // if (type.equals("1")) { |
| | | // // 手机注册 |
| | | // if (StringUtils.isEmptyString(reg.getUsername()) || reg.getUsername().length() > 20) { |
| | | // throw new BusinessException("请输入正确的手机号码"); |
| | | // } |
| | | // party.setPhone(reg.getUsername()); |
| | | // party.setPhone_authority(false); |
| | | // } else if (type.equals("2")) { |
| | | // // 邮箱注册 |
| | | // if (!Strings.isEmail(reg.getUsername())) { |
| | | // throw new BusinessException("请输入正确的邮箱地址"); |
| | | // } |
| | | // party.setEmail(reg.getUsername()); |
| | | // party.setEmail_authority(false); |
| | | // } else { |
| | | // // 用户名注册 |
| | | // if (reg.getUsername().length() < 6 || reg.getUsername().length() > 30) { |
| | | // throw new BusinessException("用户名必须6-30位"); |
| | | // } |
| | | // } |
| | | |
| | | party = this.partyService.save(party); |
| | | |