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

@@ -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,