| | |
| | | return Result.succeed(data); |
| | | } |
| | | |
| | | private String validateParam(String username, String verifcode, String password, String type) { |
| | | private String validateParam(String phone,String username, String verifcode, String password,String usercode, String type) { |
| | | |
| | | if (StringUtils.isEmptyString(username)) { |
| | | return "用户名不能为空"; |
| | | } |
| | | // if (StringUtils.isEmptyString(verifcode)) { |
| | | // return "验证码不能为空"; |
| | | // } |
| | | if (StringUtils.isEmptyString(phone)) { |
| | | return "手机号不能为空"; |
| | | } |
| | | if (StringUtils.isEmptyString(verifcode)) { |
| | | return "验证码不能为空"; |
| | | } |
| | | if (StringUtils.isEmptyString(password)) { |
| | | return "登录密码不能为空"; |
| | | } |
| | |
| | | // // 只能输入数字 |
| | | // return "登陆密码不符合设定"; |
| | | // } |
| | | // if (StringUtils.isEmptyString(this.usercode)) { |
| | | // return "推荐码不能为空"; |
| | | // } |
| | | if (StringUtils.isEmptyString(usercode)) { |
| | | return "推荐码不能为空"; |
| | | } |
| | | if (StringUtils.isEmptyString(type) || !Arrays.asList("1", "2").contains(type)) { |
| | | return "类型不能为空"; |
| | | } |
| | |
| | | * 手机/邮箱注册接口 |
| | | */ |
| | | @RequestMapping("register") |
| | | public Object register(String username, String password, String safeword, String verifcode, String usercode, String type) { |
| | | public Object register(String username, String password, String phone,String safeword, String verifcode, String usercode, String type) { |
| | | // 注册类型:1/手机;2/邮箱; |
| | | String error = this.validateParam(username, verifcode, password, type); |
| | | String error = this.validateParam(phone,username, verifcode, password, usercode,type); |
| | | if (!StringUtils.isNullOrEmpty(error)) { |
| | | throw new YamiShopBindException(error); |
| | | } |
| | |
| | | if (safeword.length() != 6 || !Strings.isNumber(safeword)) { |
| | | throw new YamiShopBindException("资金密码不符合设定"); |
| | | } |
| | | userService.saveRegister(username, password, usercode, safeword, verifcode, type); |
| | | userService.saveRegister(username, password,phone, usercode, safeword, verifcode, type); |
| | | User secUser = userService.findByUserName(username); |
| | | Log log = new Log(); |
| | | log.setCategory(Constants.LOG_CATEGORY_SECURITY); |
| | |
| | | map.put("advancedverif", party.isHighlevelAuthority()); |
| | | map.put("lastlogintime", party.getUserLasttime()); |
| | | map.put("lastloginip", party.getUserLastip()); |
| | | map.put("creditScore", party.getCreditScore()); |
| | | // 实名认证通过返回真实姓名 |
| | | if (party.isRealNameAuthority()) { |
| | | map.put("name", kyc.getName()); |