1
0
mirror of https://github.com/silenceper/wechat.git synced 2026-02-04 12:52:27 +08:00

fix: platform wx oauth and js config issue. (#302)

* fix: platform wx oauth and js config issue.

fix silenceper/wechat#301.

* fix: platform query auth code error not detected.

* feat: migrate platform oauth and js api.

* fix: func name
This commit is contained in:
NaRro
2020-08-01 20:44:01 +08:00
committed by GitHub
parent 811d71c35b
commit 6f2bd492fc
4 changed files with 139 additions and 1 deletions

View File

@@ -128,13 +128,17 @@ func (ctx *Context) QueryAuthCode(authCode string) (*AuthBaseInfo, error) {
}
var ret struct {
util.CommonError
Info *AuthBaseInfo `json:"authorization_info"`
}
if err := json.Unmarshal(body, &ret); err != nil {
return nil, err
}
if ret.ErrCode != 0 {
err = fmt.Errorf("QueryAuthCode error : errcode=%v , errmsg=%v", ret.ErrCode, ret.ErrMsg)
return nil, err
}
return ret.Info, nil
}