100字范文,内容丰富有趣,生活中的好帮手!
100字范文 > php微信公众号调用扫一扫 微信公众号中h5页面扫一扫实现

php微信公众号调用扫一扫 微信公众号中h5页面扫一扫实现

时间:2023-07-22 17:18:58

相关推荐

php微信公众号调用扫一扫 微信公众号中h5页面扫一扫实现

开发文档参考链接:https://mp./wiki?t=resources / status_main&id=mp1421141115

1 配置本地nginx

server {

listen 80;

server_name localhost;

root 代码路径;

index index.html index.htm;

location /rest {

proxy_pass 访问接口配置;

proxy_set_header Host $http_host;

proxy_set_header X-Forward-For $remote_addr;

}

}

注意监听端口一定只能是80;

2 修改本机主机,修改域名指向本地

修改C:\ Windows \ System32 \ drivers \ etc \ host.ics文件,配置localhost指向

127.0.0.1域名(该域名为公众号里边配置的域名)

也可以使用switchhost来做

3 使用网页授权URL

参考链接(请在微信客户端中打开此链接体验):

scope为snsapi_base

https://open./connect/oauth2/authorize?appid=wx520c15f417810387&redirect_uri=https%3A%2F%%2Fphp%2Findex.php%3Fd%3D%26c%3DwxAdapter%26m%3DmobileDeal%26showwxpaytitle%3D1%26vb2ctag%3D4_2030_5_1194_60&response_type=code&scope=snsapi_base&state=123#wechat_redirect

scope为snsapi_userinfo

https://open./connect/oauth2/authorize?appid=wxf0e81c3bee622d60&redirect_uri=http%3A%2F%%2Foauth_response.php&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect

4 获取openid(必须)

通过后台接口调用

5 获取wx配置

通过后台接口调用返回

配置报错,参考该链接校验:https:///ka-bu-qi-nuo/p/8659688.html

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。