From debd0a973f3421536e27d6a5e8cb7aa7c035f245 Mon Sep 17 00:00:00 2001 From: liangzai <2440983361@qq.com> Date: Wed, 11 Feb 2026 20:12:58 +0800 Subject: [PATCH] f --- internal/domains/user/services/sms_code_service.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/internal/domains/user/services/sms_code_service.go b/internal/domains/user/services/sms_code_service.go index 1c1a963..04bee03 100644 --- a/internal/domains/user/services/sms_code_service.go +++ b/internal/domains/user/services/sms_code_service.go @@ -187,8 +187,6 @@ func (s *SMSCodeService) GetCodeStatus(ctx context.Context, phone string, scene // checkRateLimit 检查发送频率限制 func (s *SMSCodeService) CheckRateLimit(ctx context.Context, phone string, scene entities.SMSScene, clientIP, userAgent string) error { - now := time.Now() - // 设备标识(这里使用 User-Agent + IP 的组合做近似设备ID,可根据实际情况调整) deviceID := fmt.Sprintf("ua:%s|ip:%s", userAgent, clientIP) @@ -274,8 +272,6 @@ func (s *SMSCodeService) checkWindowLimit(ctx context.Context, key string, ttl t // updateSendRecord 更新发送记录 func (s *SMSCodeService) updateSendRecord(ctx context.Context, phone string, scene entities.SMSScene) { - now := time.Now() - // 更新每日计数(用于后续达到上限时永久封禁) dailyKey := fmt.Sprintf("sms:phone:%s:1d", phone) var dailyCount int