fix qyglb4c0
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user