|
@@ -732,6 +732,20 @@ public class SysUserController extends BaseController {
|
|
|
String code = RandomUtil.randomNumbers(6);
|
|
String code = RandomUtil.randomNumbers(6);
|
|
|
redisTemplate.opsForValue().set(key, code, CODE_EXPIRATION, TimeUnit.MINUTES);
|
|
redisTemplate.opsForValue().set(key, code, CODE_EXPIRATION, TimeUnit.MINUTES);
|
|
|
logger.info("========================>{}<=========================", code);
|
|
logger.info("========================>{}<=========================", code);
|
|
|
|
|
+ String countKey=Constants.DEFAULT_CODE_KEY + "@" + phone+"_COUNT";
|
|
|
|
|
+ String count = redisTemplate.opsForValue().get(countKey);
|
|
|
|
|
+ if (StringUtils.isEmpty(count)){
|
|
|
|
|
+ redisTemplate.opsForValue().set(countKey,"1",60,TimeUnit.MINUTES);
|
|
|
|
|
+ }else {
|
|
|
|
|
+ if (count!=null){
|
|
|
|
|
+ int i=Integer.parseInt(count);
|
|
|
|
|
+ if (i>=5){
|
|
|
|
|
+ throw new ServiceException("验证码发送超过限制,请一小时后再试",530);
|
|
|
|
|
+ }
|
|
|
|
|
+ i++;
|
|
|
|
|
+ redisTemplate.opsForValue().set(countKey,i+"",60,TimeUnit.MINUTES);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
return stockService.sendSydSms(code, 2, null, phone);
|
|
return stockService.sendSydSms(code, 2, null, phone);
|
|
|
}
|
|
}
|
|
|
|
|
|