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:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user