fix(quqi): empty file link for non vip user (#5926)

* fix(quqi): error returned when uploading a file that existed

* fix empty download link for no vip user

* fix cannot parse request result

---------

Co-authored-by: Andy Hsu <i@nn.ci>
This commit is contained in:
Echo Response
2024-01-21 15:28:52 +08:00
committed by GitHub
parent 85a28d9822
commit d88b54d98a
3 changed files with 39 additions and 2 deletions

View File

@ -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)
@ -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)
}