f
This commit is contained in:
@@ -44,14 +44,8 @@ func (l *AgentRealNameLogic) AgentRealName(req *types.AgentRealNameReq) (resp *t
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "代理实名, 加密手机号失败: %v", err)
|
||||
}
|
||||
// 开发环境固定验证码为138888
|
||||
env := os.Getenv("ENV")
|
||||
if env == "development" {
|
||||
if req.Code != "138888" {
|
||||
return nil, errors.Wrapf(xerr.NewErrMsg("验证码不正确"), "开发环境验证码应为138888")
|
||||
}
|
||||
logx.Infof("开发环境:验证码验证通过 %s", req.Mobile)
|
||||
} else {
|
||||
// 开发环境下跳过验证码验证
|
||||
if os.Getenv("ENV") != "development" {
|
||||
// 检查手机号是否在一分钟内已发送过验证码
|
||||
redisKey := fmt.Sprintf("%s:%s", "realName", encryptedMobile)
|
||||
cacheCode, err := l.svcCtx.Redis.Get(redisKey)
|
||||
|
||||
@@ -2,14 +2,14 @@ package agent
|
||||
|
||||
import (
|
||||
"context"
|
||||
"tydata-server/app/main/model"
|
||||
"tydata-server/common/ctxdata"
|
||||
"tydata-server/common/xerr"
|
||||
"tydata-server/pkg/lzkit/crypto"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"os"
|
||||
"time"
|
||||
"tydata-server/app/main/model"
|
||||
"tydata-server/common/ctxdata"
|
||||
"tydata-server/common/xerr"
|
||||
"tydata-server/pkg/lzkit/crypto"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/zeromicro/go-zero/core/stores/redis"
|
||||
@@ -45,14 +45,8 @@ func (l *ApplyForAgentLogic) ApplyForAgent(req *types.AgentApplyReq) (resp *type
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(xerr.NewErrCode(xerr.SERVER_COMMON_ERROR), "加密手机号失败: %v", err)
|
||||
}
|
||||
// 开发环境固定验证码为138888
|
||||
env := os.Getenv("ENV")
|
||||
if env == "development" {
|
||||
if req.Code != "138888" {
|
||||
return nil, errors.Wrapf(xerr.NewErrMsg("验证码不正确"), "开发环境验证码应为138888")
|
||||
}
|
||||
logx.Infof("开发环境:验证码验证通过 %s", req.Mobile)
|
||||
} else if 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)
|
||||
|
||||
Reference in New Issue
Block a user