f
This commit is contained in:
@@ -210,16 +210,18 @@ 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
|
||||
}
|
||||
|
||||
// 返回data字段,如果为空则返回空对象
|
||||
if zhichaResp.Data != nil && len(zhichaResp.Data) > 0 {
|
||||
// 返回data字段
|
||||
return zhichaResp.Data, nil
|
||||
}
|
||||
return map[string]interface{}{}, nil
|
||||
}
|
||||
|
||||
// Encrypt 使用配置的加密密钥对数据进行AES-128-CBC加密
|
||||
|
||||
Reference in New Issue
Block a user