f
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os"
|
||||
"time"
|
||||
"tydata-server/app/main/api/internal/service"
|
||||
"tydata-server/app/main/model"
|
||||
@@ -561,7 +562,7 @@ func (l *QueryServiceLogic) DecryptData(data string) ([]byte, error) {
|
||||
// 校验验证码
|
||||
func (l *QueryServiceLogic) VerifyCode(mobile string, code string) error {
|
||||
// 开发环境下跳过验证码验证
|
||||
if l.svcCtx.Config.SystemConfig.SkipVerifyCode {
|
||||
if os.Getenv("ENV") == "development" {
|
||||
return nil
|
||||
}
|
||||
secretKey := l.svcCtx.Config.Encrypt.SecretKey
|
||||
@@ -585,10 +586,12 @@ func (l *QueryServiceLogic) VerifyCode(mobile string, code string) error {
|
||||
|
||||
// 二、三要素验证
|
||||
func (l *QueryServiceLogic) Verify(Name string, IDCard string, Mobile string) error {
|
||||
// 空报告模式:开发环境下跳过二/三要素验证
|
||||
if l.svcCtx.Config.SystemConfig.SkipVerify {
|
||||
// 开发环境下跳过二/三要素验证(避免未授权IP调用天元API失败)
|
||||
isDevelopment := os.Getenv("ENV") == "development"
|
||||
if isDevelopment {
|
||||
return nil
|
||||
}
|
||||
|
||||
if !l.svcCtx.Config.SystemConfig.ThreeVerify {
|
||||
twoVerification := service.TwoFactorVerificationRequest{
|
||||
Name: Name,
|
||||
|
||||
Reference in New Issue
Block a user