修改短信语音文案

parent 534a8130
...@@ -31,6 +31,10 @@ public interface Constants { ...@@ -31,6 +31,10 @@ public interface Constants {
String REDIS_SMS_CODE_COUNT = "SMS_verification_code_count:"; String REDIS_SMS_CODE_COUNT = "SMS_verification_code_count:";
String REDIS_SMS_IP_COUNT = "SMS_verification_code_count:"; String REDIS_SMS_IP_COUNT = "SMS_verification_code_count:";
String REDIS_SMS_DEVICE_COUNT = "SMS_verification_code_count:"; String REDIS_SMS_DEVICE_COUNT = "SMS_verification_code_count:";
String REDIS_VOICE_CODE_COUNT = "Voice_verification_code_count:";
String REDIS_VOICE_IP_COUNT = "Voice_verification_code_count:";
String REDIS_VOICE_DEVICE_COUNT = "Voice_verification_code_count:";
/** /**
* redis中token的key值前缀 * redis中token的key值前缀
*/ */
......
...@@ -224,9 +224,10 @@ public class SmsController implements IBaseController { ...@@ -224,9 +224,10 @@ public class SmsController implements IBaseController {
} }
String verificationIPCountKey = getIp(); String verificationIPCountKey = getIp();
if (!StringUtils.isEmpty(verificationIPCountKey)) { if (!StringUtils.isEmpty(verificationIPCountKey)) {
verificationIPCountKey=Constants.REDIS_SMS_IP_COUNT+verificationIPCountKey;
Long getIPVerificationCount = redisTemplate.opsForHash().increment(verificationIPCountKey, Constants.REDIS_SMS_IP_COUNT, 1); Long getIPVerificationCount = redisTemplate.opsForHash().increment(verificationIPCountKey, Constants.REDIS_SMS_IP_COUNT, 1);
if (getIPVerificationCount > 5000) { if (getIPVerificationCount > 5000) {
return JsonResult.buildErrorStateResult("您当前ip已经达到获取今天验证码上线", null); return JsonResult.buildErrorStateResult("您当前ip已经达到获取今天验证码上", null);
} }
} }
...@@ -234,7 +235,7 @@ public class SmsController implements IBaseController { ...@@ -234,7 +235,7 @@ public class SmsController implements IBaseController {
String verificationDeviceCountKey = Constants.REDIS_SMS_DEVICE_COUNT + deviceId; String verificationDeviceCountKey = Constants.REDIS_SMS_DEVICE_COUNT + deviceId;
Long getDeviceVerificationCount = redisTemplate.opsForHash().increment(verificationDeviceCountKey, Constants.REDIS_SMS_DEVICE_COUNT, 1); Long getDeviceVerificationCount = redisTemplate.opsForHash().increment(verificationDeviceCountKey, Constants.REDIS_SMS_DEVICE_COUNT, 1);
if (getDeviceVerificationCount > 20) { if (getDeviceVerificationCount > 20) {
return JsonResult.buildErrorStateResult("您当前ip已经达到获取今天验证码上线", null); return JsonResult.buildErrorStateResult("您设备已经达到获取今天短信验证码上限", null);
} }
} }
...@@ -276,17 +277,18 @@ public class SmsController implements IBaseController { ...@@ -276,17 +277,18 @@ public class SmsController implements IBaseController {
} }
String verificationIPCountKey = getIp(); String verificationIPCountKey = getIp();
if (!StringUtils.isEmpty(verificationIPCountKey)) { if (!StringUtils.isEmpty(verificationIPCountKey)) {
Long getIPVerificationCount = redisTemplate.opsForHash().increment(verificationIPCountKey, Constants.REDIS_SMS_IP_COUNT, 1); verificationIPCountKey=Constants.REDIS_VOICE_IP_COUNT+verificationIPCountKey;
Long getIPVerificationCount = redisTemplate.opsForHash().increment(verificationIPCountKey, Constants.REDIS_VOICE_IP_COUNT, 1);
if (getIPVerificationCount > 5000) { if (getIPVerificationCount > 5000) {
return JsonResult.buildErrorStateResult("您当前ip已经达到获取今天验证码上线", null); return JsonResult.buildErrorStateResult("您当前ip已经达到获取今天语音验证码上限", null);
} }
} }
if (!StringUtils.isEmpty(deviceId)) { if (!StringUtils.isEmpty(deviceId)) {
String verificationDeviceCountKey = Constants.REDIS_SMS_DEVICE_COUNT + deviceId; String verificationDeviceCountKey = Constants.REDIS_SMS_DEVICE_COUNT + deviceId;
Long getDeviceVerificationCount = redisTemplate.opsForHash().increment(verificationDeviceCountKey, Constants.REDIS_SMS_DEVICE_COUNT, 1); Long getDeviceVerificationCount = redisTemplate.opsForHash().increment(verificationDeviceCountKey, Constants.REDIS_VOICE_DEVICE_COUNT, 1);
if (getDeviceVerificationCount > 20) { if (getDeviceVerificationCount > 20) {
return JsonResult.buildErrorStateResult("您当前ip已经达到获取今天验证码上线", 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