shengbeiniao / wechat-thirdparty

微信公众号第三方平台授权及api调用实现
2 stars 0 forks source link

关于access_token问题 #1

Open jnotnull opened 7 years ago

jnotnull commented 7 years ago

通过该接口(https://api.weixin.qq.com/sns/oauth2/component/access_token?appid=APPID&code=CODE&grant_type=authorization_code&component_appid=COMPONENT_APPID&component_access_token=COMPONENT_ACCESS_TOKEN)获得的access_token去获取用户信息时, 该access_token只能用一次。 再次调用获得用户接口时候(https://api.weixin.qq.com/sns/userinfo?access_token=ACCESS_TOKEN&openid=OPENID&lang=zh_CN)就报{"errcode":40001,"errmsg":"invalid credential, access_token is invalid or not latest, hints: [ req_id: .XFMGa0631s186 ]"}了

shengbeiniao commented 7 years ago

access_token缓存在redis里面,2小时超时,你看看是否是同一个