| | |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.common.annotation.OperationLog; |
| | | import com.vincent.rsf.server.common.config.ConfigProperties; |
| | | import com.vincent.rsf.server.common.domain.BusinessRes; |
| | | import com.vincent.rsf.server.common.security.JwtSubject; |
| | | import com.vincent.rsf.server.common.service.EmailService; |
| | | import com.vincent.rsf.server.common.service.RedisService; |
| | |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | // verify code |
| | | if (!param.getCode().equals(configProperties.getSecurityCode())) { |
| | | String cacheCode = redisService.getValue(EmailType.REGISTER_VERIFY.toString(), param.getEmail()); |
| | | if (Cools.isEmpty(cacheCode)) { |
| | | return R.error("The verification code has expired."); |
| | | } |
| | | if (!cacheCode.equals(param.getCode())) { |
| | | return R.error("The verification code is incorrect."); |
| | | } |
| | | } |
| | | |
| | | // register |
| | |
| | | return R.error("Please Login First"); |
| | | } |
| | | if (!userService.comparePassword(userService.getById(userId).getPassword(), param.getOldPassword())) { |
| | | return R.parse("408-The Current Password Was Incorrect"); |
| | | return R.parse(BusinessRes.INVALID_PASSWORD); |
| | | } |
| | | User user = new User(); |
| | | user.setId(userId); |