mirror of https://github.com/Xhofe/alist
fix(139): incorrect refreshTokenResp serialization (#6248)
parent
88947f6676
commit
022e0ca292
|
@ -64,7 +64,7 @@ func (d *Yun139) refreshToken() error {
|
||||||
splits := strings.Split(decodeStr, ":")
|
splits := strings.Split(decodeStr, ":")
|
||||||
reqBody := "<root><token>" + splits[2] + "</token><account>" + splits[1] + "</account><clienttype>656</clienttype></root>"
|
reqBody := "<root><token>" + splits[2] + "</token><account>" + splits[1] + "</account><clienttype>656</clienttype></root>"
|
||||||
_, err = base.RestyClient.R().
|
_, err = base.RestyClient.R().
|
||||||
//ForceContentType("application/json").
|
ForceContentType("application/xml").
|
||||||
SetBody(reqBody).
|
SetBody(reqBody).
|
||||||
SetResult(&resp).
|
SetResult(&resp).
|
||||||
Post(url)
|
Post(url)
|
||||||
|
@ -74,7 +74,7 @@ func (d *Yun139) refreshToken() error {
|
||||||
if resp.Return != "0" {
|
if resp.Return != "0" {
|
||||||
return fmt.Errorf("failed to refresh token: %s", resp.Desc)
|
return fmt.Errorf("failed to refresh token: %s", resp.Desc)
|
||||||
}
|
}
|
||||||
d.Authorization = base64.StdEncoding.EncodeToString([]byte(splits[0] + splits[1] + ":" + resp.Token))
|
d.Authorization = base64.StdEncoding.EncodeToString([]byte(splits[0] + ":" + splits[1] + ":" + resp.Token))
|
||||||
op.MustSaveDriverStorage(d)
|
op.MustSaveDriverStorage(d)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue