| | |
| | | String key = username; |
| | | String authcode = identifyingCodeTimeWindowService.getAuthCode(key); |
| | | if ((authcode == null) || (!authcode.equals(verifcode))) { |
| | | throw new YamiShopBindException("验证码不正确"); |
| | | throw new YamiShopBindException("The verification code is incorrect."); |
| | | } |
| | | if ("true".equals(this.sysparaService.find("register_need_usercode").getSvalue())) { |
| | | |
| | | if (StringUtils.isNotEmpty(usercode)) { |
| | | if (null == party_reco) { |
| | | throw new YamiShopBindException("推荐码不正确"); |
| | | throw new YamiShopBindException("The referral code is incorrect."); |
| | | } |
| | | if (Constants.SECURITY_ROLE_TEST.equals(party_reco.getRoleName())) { |
| | | throw new YamiShopBindException("推荐人无权限推荐"); |
| | | throw new YamiShopBindException("The recommender has no authority to make the recommendation."); |
| | | } |
| | | if (!party_reco.isEnabled()) { |
| | | throw new YamiShopBindException("推荐人无权限推荐"); |
| | | throw new YamiShopBindException("The recommender has no authority to make the recommendation."); |
| | | } |
| | | } else { |
| | | throw new YamiShopBindException("Please enter the referral code."); |
| | | } |
| | | } |
| | | // if ("true".equals(this.sysparaService.find("register_need_usercode_turn").getSvalue())) { |
| | |
| | | // } |
| | | // } |
| | | if (findByUserName(username) != null) { |
| | | throw new YamiShopBindException("用户名重复"); |
| | | throw new YamiShopBindException("Username duplication"); |
| | | } |
| | | int ever_user_level_num = this.sysparaService.find("ever_user_level_num").getInteger(); |
| | | int ever_user_level_num_custom = this.sysparaService.find("ever_user_level_num_custom").getInteger(); |
| | |
| | | if (StringUtils.isEmptyString(username) || username.length() > 20) { |
| | | throw new YamiShopBindException("请输入正确的手机号码"); |
| | | } |
| | | this.savePhone(username, party.getUserId().toString()); |
| | | User partyPhone = findPartyByVerifiedPhone(username); |
| | | if (null != partyPhone) { |
| | | throw new YamiShopBindException("电话号码已绑定其他用户"); |
| | | } |
| | | this.savePhone(username, party.getUserId()); |
| | | } else { |
| | | // 邮箱注册 |
| | | if (!Strings.isEmail(username)) { |
| | | throw new YamiShopBindException("请输入正确的邮箱地址"); |
| | | throw new YamiShopBindException("Please enter the correct email address."); |
| | | } |
| | | if (findPartyByEmail(username) != null) { |
| | | throw new YamiShopBindException("邮箱已重复"); |
| | | throw new YamiShopBindException("The email address has been duplicated."); |
| | | } |
| | | this.saveEmail(username, party.getUserId().toString()); |
| | | } |
| | |
| | | userRecom.setUserId(party_reco.getUserId()); |
| | | userRecom.setRecomUserId(party.getUserId()); |
| | | this.userRecomService.save(userRecom); |
| | | party = getById(party.getUserId()); |
| | | party.setUserRecom(party_reco.getUserId()); |
| | | updateById(party); |
| | | } |
| | |
| | | party.setSafePassword(passwordEncoder.encode("000000")); |
| | | party.setLoginPassword(passwordEncoder.encode(password)); |
| | | party.setRoleName(Constants.SECURITY_ROLE_GUEST); |
| | | party.setCreditScore(80); |
| | | save(party); |
| | | if (!StringUtils.isNullOrEmpty(parents_usercode)) { |
| | | User party_parents = findUserByUserCode(parents_usercode); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public User findByUserNameOrEmailOrPhone(String userName) { |
| | | User user = getOne(new LambdaQueryWrapper<User>() |
| | | .eq(User::getUserName, userName) |
| | | .or(x -> |
| | | x.eq(User::getUserMobile, userName).eq(User::isUserMobileBind, true)) |
| | | .or(x -> |
| | | x.eq(User::getUserMail, userName).eq(User::isMailBind, true)) |
| | | |
| | | ); |
| | | return user; |
| | | } |
| | | |
| | | @Override |
| | | public User findByUserMobile(String mobile) { |
| | | return getOne(new LambdaQueryWrapper<User>().eq(User::getUserMobile, mobile)); |
| | | } |