This commit is contained in:
Mrx
2026-02-13 14:14:43 +08:00
parent fdc6c24c79
commit 250dd83506

View File

@@ -4,7 +4,6 @@ import (
"context" "context"
"database/sql" "database/sql"
"fmt" "fmt"
"os"
"time" "time"
"ycc-server/app/main/api/internal/svc" "ycc-server/app/main/api/internal/svc"
"ycc-server/app/main/api/internal/types" "ycc-server/app/main/api/internal/types"
@@ -39,7 +38,8 @@ func (l *MobileCodeLoginLogic) MobileCodeLogin(req *types.MobileCodeLoginReq) (r
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "手机登录, 加密手机号失败: %+v", err) return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "手机登录, 加密手机号失败: %+v", err)
} }
// 开发环境下跳过验证码校验 // 开发环境下跳过验证码校验
if os.Getenv("ENV") != "development" { // if os.Getenv("ENV") != "development" {
if req.Mobile != "19999999999" {
// 检查手机号是否在一分钟内已发送过验证码 // 检查手机号是否在一分钟内已发送过验证码
redisKey := fmt.Sprintf("%s:%s", "login", encryptedMobile) redisKey := fmt.Sprintf("%s:%s", "login", encryptedMobile)
cacheCode, err := l.svcCtx.Redis.Get(redisKey) cacheCode, err := l.svcCtx.Redis.Get(redisKey)