Compare commits

..

2 Commits

Author SHA1 Message Date
Mrx
e246271a24 f 2026-04-23 18:18:47 +08:00
Mrx
a1024ed4b2 f 2026-04-23 17:59:23 +08:00
2 changed files with 3 additions and 4 deletions

View File

@@ -47,8 +47,6 @@ func ProcessJRZQO7L1Request(ctx context.Context, params []byte, deps *processors
"city": null,
}
// 使用 WithSkipCode201Check 不跳过 201 错误检查,当 Code == "201" 时返回错误
// ctx = zhicha.WithSkipCode201Check(ctx)
respData, err := deps.ZhichaService.CallAPI(ctx, "ZCI080", reqData)
if err != nil {
if errors.Is(err, zhicha.ErrDatasource) {

View File

@@ -212,11 +212,12 @@ func (z *ZhichaService) CallAPI(ctx context.Context, proID string, params map[st
// 201 表示查询为空兼容其它情况如果data也为空则返回空对象
if zhichaResp.Code == "201" {
// 先做类型断言
dataMap, ok := zhichaResp.Data.(map[string]interface{})
if ok && len(dataMap) > 0 {
if ok {
// 即使是 {},也原样返回
return dataMap, nil
}
// 兜底:防止解密异常
return map[string]interface{}{}, nil
}