This commit is contained in:
dute7liang
2024-01-21 22:16:01 +08:00
parent a585537c91
commit 3b411975ff

View File

@@ -91,9 +91,9 @@ public class SmsVerifyServiceImpl extends ServiceImpl<SmsVerifyMapper,SmsVerify>
.gt(SmsVerify::getOverTime, now)
.last("limit 1"));
if(one != null){
long diff = now.until(one.getCreateTime(), ChronoUnit.SECONDS);
if(diff < 60){
throw new ServiceException(""+diff+"秒之后再重试发送!");
long diff = one.getCreateTime().until(now, ChronoUnit.SECONDS);
if(diff < 100){
throw new ServiceException(""+(100-diff)+"秒之后再重试发送!");
}
}
long count = userInfoService.count(Wrappers.lambdaQuery(UserInfo.class).eq(UserInfo::getRegIp, clientIP));