Skip to content

Commit

Permalink
fix(139): incorrect refreshTokenResp serialization (#6248)
Browse files Browse the repository at this point in the history
  • Loading branch information
zzc10086 authored Mar 24, 2024
1 parent 88947f6 commit 022e0ca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/139/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (d *Yun139) refreshToken() error {
splits := strings.Split(decodeStr, ":")
reqBody := "<root><token>" + splits[2] + "</token><account>" + splits[1] + "</account><clienttype>656</clienttype></root>"
_, err = base.RestyClient.R().
//ForceContentType("application/json").
ForceContentType("application/xml").
SetBody(reqBody).
SetResult(&resp).
Post(url)
Expand All @@ -74,7 +74,7 @@ func (d *Yun139) refreshToken() error {
if resp.Return != "0" {
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)
return nil
}
Expand Down

0 comments on commit 022e0ca

Please sign in to comment.