chore: 调整登陆验证码24小时最多5条

This commit is contained in:
2025-12-18 11:27:16 +08:00
parent 1d5cb319a9
commit 2df5027c0f

View File

@@ -53,10 +53,10 @@ export class SmsService {
}); });
if (recentRecord && recentRecord.createdAt > oneMinuteAgo) { if (recentRecord && recentRecord.createdAt > oneMinuteAgo) {
throw new BusinessException({ message: '操作太快了,一分钟后重试吧' }); // 距离上一条不足 1 分钟 throw new BusinessException({ message: '操作太快了,稍后再重试吧' }); // 距离上一条不足 1 分钟
} }
// 2. 检查 24 小时内是否超过 10 // 2. 检查 24 小时内是否超过 5
const count = await this.smsRecordRepository.count({ const count = await this.smsRecordRepository.count({
where: { where: {
phone, phone,
@@ -65,8 +65,8 @@ export class SmsService {
}, },
}); });
if (count >= 10) { if (count >= 5) {
throw new BusinessException({ message: '操作太快了,稍后再重试吧' }); // 24 小时超过 10 throw new BusinessException({ message: '操作太快了,稍后再重试吧' }); // 24 小时超过 5
} }
} }