修改短信验证

parent 68105c03
...@@ -343,8 +343,6 @@ public class SmsController implements IBaseController { ...@@ -343,8 +343,6 @@ public class SmsController implements IBaseController {
private void deleteRetSendCode(String phoneNo){ private void deleteRetSendCode(String phoneNo){
String verificationCountKey = Constants.REDIS_VERIFICATION_COUNT+phoneNo; String verificationCountKey = Constants.REDIS_VERIFICATION_COUNT+phoneNo;
redisTemplate.opsForHash().delete(verificationCountKey, Constants.REDIS_VERIFICATION_COUNT); redisTemplate.opsForHash().delete(verificationCountKey, Constants.REDIS_VERIFICATION_COUNT);
String key = Constants.REDIS_PREFIX_VERIFICATION_CODE + phoneNo;
redisTemplate.delete(key);
} }
} }
...@@ -353,6 +353,8 @@ public class UserController implements IBaseController { ...@@ -353,6 +353,8 @@ public class UserController implements IBaseController {
} }
if (!smsService.validRegisterOrResetPasswdVerificationCode(phoneNo, verificationCode)) { if (!smsService.validRegisterOrResetPasswdVerificationCode(phoneNo, verificationCode)) {
if(needRetSendCode(phoneNo)){ if(needRetSendCode(phoneNo)){
String key = Constants.REDIS_PREFIX_VERIFICATION_CODE + phoneNo;
stringRedisTemplate.delete(key);
return JsonResult.buildErrorStateResult("错误次数过多,请重新获取短信验证码", null); return JsonResult.buildErrorStateResult("错误次数过多,请重新获取短信验证码", null);
} }
return JsonResult.buildErrorStateResult("短信验证码错误", null); return JsonResult.buildErrorStateResult("短信验证码错误", null);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment