fix qyglb4c0

This commit is contained in:
2025-04-21 23:33:18 +08:00
parent 2fef946759
commit 6f0b876dfc
2 changed files with 162 additions and 0 deletions

View File

@@ -3,6 +3,7 @@ package QYGL
import (
"context"
"encoding/hex"
"encoding/json"
"tianyuan-api/apps/api/internal/common"
"tianyuan-api/apps/api/internal/validator"
"tianyuan-api/apps/api/internal/westmodel"
@@ -97,6 +98,15 @@ func (l *QYGLB4C0Logic) QYGLB4C0(req *types.Request) (resp string, err *errs.App
westResp, callAPIErr := l.svcCtx.WestDexService.CallAPISecond("G05HZ01", apiRequest, l.svcCtx.Config.WestConfig.SecretSecondId)
if callAPIErr != nil {
if callAPIErr.Code == errs.ErrDataSource.Code {
// 检查是否是1404错误库中无此记录
var westData map[string]interface{}
if err := json.Unmarshal(westResp, &westData); err == nil {
// 日志显示错误码在顶层的"code"字段
if code, ok := westData["code"].(string); ok && code == "1404" {
return "", errs.ErrNotFound
}
}
encryptData, aesEncrypt := crypto.AesEncrypt(westResp, key)
if aesEncrypt != nil {
return "", errs.ErrSystem