|
|
@@ -23,6 +23,7 @@ import org.springframework.util.Assert; |
|
|
|
import java.time.Duration; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.util.Collections; |
|
|
|
import java.util.Objects; |
|
|
|
|
|
|
|
/** |
|
|
|
* @author liuxinxin |
|
|
@@ -81,7 +82,7 @@ public class SmsManage { |
|
|
|
|
|
|
|
cachePlusOps.set(new CacheKey(cacheKey, Duration.ofMinutes(verificationCodeTypeEnum.getExpireTime())), cache); |
|
|
|
String limitKey = SmsRedisKeyUtils.smsSendLimitKey(verificationCodeTypeEnum, request.getMobile()); |
|
|
|
if (StringUtils.isNotBlank(cachePlusOps.get(limitKey))) { |
|
|
|
if (Objects.nonNull(cachePlusOps.get(limitKey))) { |
|
|
|
long limitCount = cachePlusOps.incr(new CacheKey(limitKey, Duration.ofSeconds(DateUtil.restSecondsFromNowToNoon()))); |
|
|
|
// 超出单日发送次数之后直接锁定 |
|
|
|
if (limitCount >= verificationCodeTypeEnum.getSendTimesByDay().longValue()) { |
|
|
|