f
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os"
|
||||
"time"
|
||||
"tydata-server/app/main/api/internal/service"
|
||||
"tydata-server/app/main/model"
|
||||
@@ -558,6 +559,16 @@ func (l *QueryServiceLogic) DecryptData(data string) ([]byte, error) {
|
||||
|
||||
// 校验验证码
|
||||
func (l *QueryServiceLogic) VerifyCode(mobile string, code string) error {
|
||||
// 开发环境固定验证码为138888
|
||||
env := os.Getenv("ENV")
|
||||
if env == "development" {
|
||||
if code == "138888" {
|
||||
logx.Infof("开发环境:验证码验证通过 %s", mobile)
|
||||
return nil
|
||||
}
|
||||
return errors.Wrapf(xerr.NewErrMsg("验证码不正确"), "开发环境验证码应为138888: %s", mobile)
|
||||
}
|
||||
|
||||
secretKey := l.svcCtx.Config.Encrypt.SecretKey
|
||||
encryptedMobile, err := crypto.EncryptMobile(mobile, secretKey)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user