fix serialize

This commit is contained in:
2024-10-24 21:48:01 +08:00
parent 73999a8452
commit faef357487
4 changed files with 24 additions and 11 deletions

View File

@ -345,7 +345,7 @@ func (hc *HttpClient) fillResponseBody(response *define.Response) {
response.Data = businessData.String()
} else {
// 返回是普通类型
response.Data = serialize.JSON.MarshalForString(map[string]any{
response.Data = serialize.JSON.MarshalForStringIgnoreError(map[string]any{
"value": businessData.Value(),
})
}
@ -421,7 +421,7 @@ func (hc *HttpClient) setCacheResult(response *define.Response) (bool, error) {
return false, nil
}
cacheKey := hc.cacheInstance.GetKey(hc.reqConfig)
cacheValue := serialize.JSON.MarshalForString(response)
cacheValue := serialize.JSON.MarshalForStringIgnoreError(response)
if err := hc.cacheInstance.SetValue(cacheKey, cacheValue); nil != err {
return false, err
}