| | |
| | | model.setLoginSafeword(passwordManager.decryptPassword(model.getLoginSafeword())); |
| | | SysUser sysUser = sysUserService.getSysUserById( SecurityUtils.getSysUser().getUserId()); |
| | | if(!passwordEncoder.matches(model.getLoginSafeword(), sysUser.getSafePassword())) { |
| | | throw new YamiShopBindException("资金密码不正确!"); |
| | | throw new YamiShopBindException("Incorrect fund password!"); |
| | | } |
| | | UserRecom userRecom= userRecomService.getById(model.getId()); |
| | | if (userRecom==null){ |
| | | throw new YamiShopBindException("参数错误!"); |
| | | throw new YamiShopBindException("Invalid parameters!"); |
| | | } |
| | | User user=userService.findUserByUserCode(model.getUserCode()); |
| | | if (user==null){ |
| | | throw new YamiShopBindException("推荐人UID错误"); |
| | | throw new YamiShopBindException("Invalid referrer UID"); |
| | | } |
| | | userRecom.setRecomUserId(user.getUserId()); |
| | | userRecomService.updateById(userRecom); |