This commit is contained in:
2026-03-10 17:28:22 +08:00
5 changed files with 24 additions and 5 deletions

View File

@@ -210,8 +210,13 @@ func (z *ZhichaService) CallAPI(ctx context.Context, proID string, params map[st
return nil, ErrDatasource
}
// 201 表示查询为空,返回空对象
// 201 表示查询为空,兼容其它情况如果data也为空返回空对象
if zhichaResp.Code == "201" {
// 先做类型断言
dataMap, ok := zhichaResp.Data.(map[string]interface{})
if ok && len(dataMap) > 0 {
return dataMap, nil
}
return map[string]interface{}{}, nil
}