- 目的是要获取 openid
-
在小程序里做一个 iframe ,打开网页授权
https://dj.xxx.com/public?s=/index/member/setmpopenid&xmtoken=420b5c0714c792a9ac21919137d4eff4&uid=1
- 调用接口
https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxb2a31baefb1b0911&redirect_uri=https%3A%2F%2Fdj.xiaomianaokeji.com%2Fpublic%2Findex.php%3Ffrom%3Dmp%26s%3D%2Findex%2Fwechatmp%2Fgetopenidres%26i%3D1%26xmtoken%3D18308fbca73b16e831dda8fc12c93a98%26uid%3D1%26backurl%3Dhttps%253A%252F%252Fdj.xiaomianaokeji.com%252Fpublic%252Findex.php%253Fs%253D%252Findex%252Fmember%252Fsetmpopenid%2526xmtoken%253D18308fbca73b16e831dda8fc12c93a98%2526uid%253D1&response_type=code&scope=snsapi_base&state=dc384bb606de227589b4f5afbecbadd9&connect_redirect=1#wechat_redirect
-
注意要配置域名,在 服务号-设置与开发-账号设置-功能设置-网页授权域名
转载请注明:大后端 » 小程序实现绑定服务号通知