Update:测试环境添加默认验证码
This commit is contained in:
parent
fc98ef9956
commit
30a8013e1d
@ -3,10 +3,11 @@ package domain
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/fonchain_enterprise/micro-account/pkg/cache"
|
||||
"github.com/fonchain_enterprise/micro-account/pkg/common/redis_key"
|
||||
"github.com/fonchain_enterprise/micro-account/pkg/m"
|
||||
"time"
|
||||
)
|
||||
|
||||
func CheckMsg(key string) error {
|
||||
|
||||
@ -491,8 +491,16 @@ func (a *AccountFieeProvider) Register(_ context.Context, in *account.RegistRequ
|
||||
if in.Code == "" {
|
||||
return &account.RegisterResponse{Status: m.Unknown}, errors.New(m.Mobile_Wrong_Code)
|
||||
}
|
||||
if err := domain.CheckRegisterCode(in.Domain, in.TelAreaCode+in.TelNum, in.Code); err != nil {
|
||||
return &account.RegisterResponse{Status: m.Unknown}, errors.New(m.Mobile_Code_Wrong)
|
||||
|
||||
// 测试环境支持万能验证码 888888
|
||||
isTestCode := cmdConfig.AppConfig != nil &&
|
||||
cmdConfig.AppConfig.System.Mode != "prod" &&
|
||||
in.Code == "888888"
|
||||
|
||||
if !isTestCode {
|
||||
if err := domain.CheckRegisterCode(in.Domain, in.TelAreaCode+in.TelNum, in.Code); err != nil {
|
||||
return &account.RegisterResponse{Status: m.Unknown}, errors.New(m.Mobile_Code_Wrong)
|
||||
}
|
||||
}
|
||||
// 手机号是否已注册
|
||||
var tempUser *model.User
|
||||
|
||||
Loading…
Reference in New Issue
Block a user