This commit is contained in:
Mrx
2026-04-23 17:59:23 +08:00
parent d6b78a5d6d
commit a1024ed4b2
3 changed files with 13 additions and 14 deletions

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
}