Skip to content

Commit 022e0ca

Browse files
authored
fix(139): incorrect refreshTokenResp serialization (#6248)
1 parent 88947f6 commit 022e0ca

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/139/util.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func (d *Yun139) refreshToken() error {
6464
splits := strings.Split(decodeStr, ":")
6565
reqBody := "<root><token>" + splits[2] + "</token><account>" + splits[1] + "</account><clienttype>656</clienttype></root>"
6666
_, err = base.RestyClient.R().
67-
//ForceContentType("application/json").
67+
ForceContentType("application/xml").
6868
SetBody(reqBody).
6969
SetResult(&resp).
7070
Post(url)
@@ -74,7 +74,7 @@ func (d *Yun139) refreshToken() error {
7474
if resp.Return != "0" {
7575
return fmt.Errorf("failed to refresh token: %s", resp.Desc)
7676
}
77-
d.Authorization = base64.StdEncoding.EncodeToString([]byte(splits[0] + splits[1] + ":" + resp.Token))
77+
d.Authorization = base64.StdEncoding.EncodeToString([]byte(splits[0] + ":" + splits[1] + ":" + resp.Token))
7878
op.MustSaveDriverStorage(d)
7979
return nil
8080
}

0 commit comments

Comments
 (0)