html52.com
我爱小程序-开发者交流社区

小程序通过授权码获取用户基本信息accesstoken过程中授权失败api unauthorized

框架类型 问题类型 操作时间 AppID
小程序 Bug 16小时前 wx55b5b6d95c648041

https://developers.weixin.qq.com/doc/oplatform/Mobile_App/WeChat_Login/Authorized_API_call_UnionID.html

你好,根据这个文档中的流程,后端获取用户的基本信息和unionId,

1、小程序前端获取到授权的code,然后把code请求到后端服务器,服务器接口地址已经在小程序公众平台上面做了绑定,然后把code,appid,secret

通过接口 https://api.weixin.qq.com/sns/oauth2/access_token,获取access_token, 第一次返回

{"errcode":48001,"errmsg":"api unauthorized, hints: [ req_id: MenEZ44ce-yQW0aa ]"}

后面就一直接提示code已经使用了

请求下这是什么哪里的出问题了

网友回复

James¹⁰¹⁴:

你这个接口是app微信授权登录吧。

小程序的看考这个 https://developers.weixin.qq.com/miniprogram/dev/api/open-api/user-info/wx.getUserInfo.html

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

真正的个人免签约支付接口

云免签H5支付