This commit is contained in:
Mrx
2026-01-26 15:47:59 +08:00
parent 018abc95d6
commit 67082972a9
8 changed files with 17 additions and 16 deletions

View File

@@ -4,6 +4,7 @@ import (
"context"
"database/sql"
"fmt"
"os"
"time"
"tydata-server/app/main/api/internal/service"
@@ -44,7 +45,7 @@ func (l *AgentRealNameLogic) AgentRealName(req *types.AgentRealNameReq) (resp *t
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "代理实名, 加密手机号失败: %v", err)
}
// 开发环境下跳过验证码验证
if !l.svcCtx.Config.SystemConfig.SkipVerifyCode {
if os.Getenv("ENV") != "development" {
// 检查手机号是否在一分钟内已发送过验证码
redisKey := fmt.Sprintf("%s:%s", "realName", encryptedMobile)
cacheCode, err := l.svcCtx.Redis.Get(redisKey)

View File

@@ -4,6 +4,7 @@ import (
"context"
"database/sql"
"fmt"
"os"
"time"
"tydata-server/app/main/model"
"tydata-server/common/ctxdata"
@@ -45,7 +46,7 @@ func (l *ApplyForAgentLogic) ApplyForAgent(req *types.AgentApplyReq) (resp *type
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "加密手机号失败: %v", err)
}
// 开发环境下跳过验证码验证,或者特定手机号跳过(保留原有逻辑)
if !l.svcCtx.Config.SystemConfig.SkipVerifyCode && req.Mobile != "18889793585" {
if os.Getenv("ENV") != "development" && req.Mobile != "18889793585" {
// 校验验证码
redisKey := fmt.Sprintf("%s:%s", "agentApply", encryptedMobile)
cacheCode, err := l.svcCtx.Redis.Get(redisKey)