修改语音上限

parent 01ddae6c
...@@ -45,9 +45,10 @@ public class SmsController implements IBaseController { ...@@ -45,9 +45,10 @@ public class SmsController implements IBaseController {
private static final String IMAGE_PHONE_COUNT = "image:phone"; private static final String IMAGE_PHONE_COUNT = "image:phone";
private static final String IMAGE_DEVICEID_COUNT = "image:deviceId:"; private static final String IMAGE_DEVICEID_COUNT = "image:deviceId:";
private static final Long IP_MAX_PER_DAY = 5000L; private static final Long IP_MAX_PER_DAY = 5000L;//ip上限
private static final Long PHONE_MAX_PER_DAY = 20L; private static final Long PHONE_MAX_PER_DAY = 20L;//手机号短信上限
private static final Long DEVICE_MAX_PER_DAY = 20L; private static final Long PHONE_VOICE_MAX_PER_DAY = 5L;//手机号语音上限
private static final Long DEVICE_MAX_PER_DAY = 20L;//设备每天上限
/** /**
* 短信验证码: for H5 * 短信验证码: for H5
* 使用 @FPLock 注解并加入自定义限制参数, 做针对手机号的发送次数限制 * 使用 @FPLock 注解并加入自定义限制参数, 做针对手机号的发送次数限制
...@@ -278,7 +279,7 @@ public class SmsController implements IBaseController { ...@@ -278,7 +279,7 @@ public class SmsController implements IBaseController {
String verificationCountKey = Constants.REDIS_VOICE_CODE_COUNT + phoneNo; String verificationCountKey = Constants.REDIS_VOICE_CODE_COUNT + phoneNo;
Long getVerificationCount = redisTemplate.opsForHash().increment(verificationCountKey, usage.toString(), 1); Long getVerificationCount = redisTemplate.opsForHash().increment(verificationCountKey, usage.toString(), 1);
if (getVerificationCount > PHONE_MAX_PER_DAY) { if (getVerificationCount > PHONE_VOICE_MAX_PER_DAY) {
return JsonResult.buildErrorStateResult("今天已获取5次语音验证码,请使用短信验证码或明天再试", null); return JsonResult.buildErrorStateResult("今天已获取5次语音验证码,请使用短信验证码或明天再试", null);
} }
String verificationIPCountKey = getIp(); String verificationIPCountKey = getIp();
......
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