- change according to weixinapi refactor

This commit is contained in:
gazebo
2019-02-21 16:37:00 +08:00
parent 9e7a41c80e
commit 3d338cf441
4 changed files with 5 additions and 5 deletions

View File

@@ -78,7 +78,7 @@ func getSNSInfoFromCache(openID string) (wxUserinfo *weixinapi.SNSUserInfo, pass
func GetWeiXinUserInfo(code string, state string) (userInfo *UserInfoExt, err error) {
globals.SugarLogger.Debugf("GetUserInfo code:%s", code)
if state == "" {
token, err2 := api.WeixinAPI.SNSGetToken(code)
token, err2 := api.WeixinAPI.SNSRetrieveToken(code)
if err = err2; err == nil {
wxUserinfo, err2 := api.WeixinAPI.SNSGetUserInfo(token.AccessToken, token.OpenID)
if err = err2; err == nil {