Skip to content

Commit

Permalink
fix cannot parse request result
Browse files Browse the repository at this point in the history
  • Loading branch information
EchoResponse committed Jan 21, 2024
1 parent c821005 commit f762521
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/quqi/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (d *Quqi) request(host string, path string, method string, callback base.Re
req.SetHeaders(map[string]string{
"Origin": "https://quqi.com",
"Cookie": d.Cookie,
}).SetResult(&result)
})

if d.GroupID != "" {
req.SetQueryParam("quqiid", d.GroupID)
Expand All @@ -46,6 +46,11 @@ func (d *Quqi) request(host string, path string, method string, callback base.Re
if err != nil {
return nil, err
}
// resty.Request.SetResult cannot parse result correctly sometimes
err = utils.Json.Unmarshal(res.Body(), &result)
if err != nil {
return nil, err
}
if result.Code != 0 {
return nil, errors.New(result.Message)
}
Expand Down

0 comments on commit f762521

Please sign in to comment.