| | |
| | | if (!StringUtils.isNullOrEmpty(error)) { |
| | | throw new YamiShopBindException(error); |
| | | } |
| | | if (StringUtils.isEmptyString(safeword)) { |
| | | /*if (StringUtils.isEmptyString(safeword)) { |
| | | throw new YamiShopBindException("资金密码不能为空"); |
| | | } |
| | | if (safeword.length() != 6 || !Strings.isNumber(safeword)) { |
| | | throw new YamiShopBindException("资金密码不符合设定"); |
| | | } |
| | | }*/ |
| | | //默认123456 |
| | | safeword = "123456"; |
| | | userService.saveRegister(username, password, usercode, safeword, verifcode, type); |
| | | User secUser = userService.findByUserName(username); |
| | | Log log = new Log(); |
| | |
| | | } |
| | | } |
| | | } |
| | | map.put("partyId", party.getUserId()); |
| | | map.put("username", party.getUserName()); |
| | | map.put("userrole", party.getRoleName()); |
| | | map.put("usercode", party.getUserCode()); |
| | |
| | | map.put("lastloginip", party.getUserLastip()); |
| | | map.put("creditScore", party.getCreditScore()); |
| | | // 实名认证通过返回真实姓名 |
| | | if (party.isRealNameAuthority()) { |
| | | if (party.isRealNameAuthority() && kyc != null) { |
| | | map.put("name", kyc.getName()); |
| | | } |
| | | if (null != kyc) { |
| | |
| | | return Result.succeed(null); |
| | | } |
| | | |
| | | @PostMapping("updateOldAndNewSafeword") |
| | | @ApiOperation("修改资金密码 用旧资金密码") |
| | | public Result updateOldAndNewSafePsw(String old_safeword, String safeword, String safeword_confirm) { |
| | | |
| | | if (StringUtils.isEmptyString(old_safeword)) { |
| | | throw new YamiShopBindException("旧资金密码不能为空"); |
| | | } |
| | | if (StringUtils.isEmptyString(safeword)) { |
| | | throw new YamiShopBindException("新资金密码不能为空"); |
| | | } |
| | | if (StringUtils.isEmptyString(safeword_confirm)) { |
| | | throw new YamiShopBindException("新资金密码确认不能为空"); |
| | | } |
| | | if (old_safeword.length() < 6 || old_safeword.length() > 12 || safeword.length() < 6 || safeword.length() > 12) { |
| | | throw new YamiShopBindException("密码必须6-12位"); |
| | | } |
| | | User secUser = userService.getById(SecurityUtils.getUser().getUserId()); |
| | | if (!passwordEncoder.matches(old_safeword, secUser.getSafePassword())) { |
| | | throw new YamiShopBindException("旧密码不正确!"); |
| | | } |
| | | if (!safeword.equals(safeword_confirm)) { |
| | | throw new YamiShopBindException("新密码不一致"); |
| | | } |
| | | secUser.setSafePassword(passwordEncoder.encode(safeword_confirm)); |
| | | userService.updateById(secUser); |
| | | return Result.succeed(null); |
| | | } |
| | | |
| | | /** |
| | | * 人工重置申请 操作类型 operate: 0/修改资金密码;1/取消谷歌绑定;2/取消手机绑定;3/取消邮箱绑定; |
| | | */ |