有思俱乐部学习园地

微信授权接口

使用示例

  1. 前往微信公众平台 -> 接口权限 -> 网页授权获取用户基本信息 -> 修改,填写授权回调页面域名,例如api.1473.cn/index

  2. api.1473.cn/index域名下部署get-weixin-code.html例如:http://api.1473.cn/index/get-weixin-code.html

  3. 假设你的 http://www.1473.com/hello-world.html 这个页面需要获取微信授权,那么你应该使用以下地址来获取授权: http://api.1473.cn/index/get-weixin-code.html?appid=XXXX&scope=snsapi_base&state=hello-world&redirect_uri=http%3A%2F%2Fwww.xyz.com%2Fhello-world.html

  4. 这样最终就会跳转到这样一个地址: http://www.1473.com/hello-world.html?code=XXXXXXXXXXXXXXXXX&state=hello-world,从而你就拿到了授权code以及自定义的state参数了

代理工作示意图如下图所示:

目前接口可以通过已部署完成的 http://api.1473.cn/index/index.html 调用

接口运行于10.3.14.70


工作人员

 
作者: 赖杰辉
信息录入: 赖杰辉