经过这篇文章,成功获取到了Openid:php
http://www.cnblogs.com/txw1958/p/weixin76-user-info.htmlhtml
官方参考:https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1455784140&token=&lang=zh_CNweb
但也遇到几个问题:api
1,redirect_uri 参数错误微信
https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8888888888888888&redirect_uri=http://mascot.duapp.com/oauth2.php&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirec
用正确的appid和redirect_uri替换后,在微信web开发工具中输入连接,出现此错误
缘由:受权回调页面域名未设置
设置地址位置:
登陆公众平台:
开发——>接口权限——>网页帐号——>修改
2,Scope 参数错误或没有 Scope 权限
经过对受权回调页面的设置,原本已经正常了,出现这个问题的缘由是,在复制连接地址的过程当中,不当心在地址中加入了回车键,以下:
https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8888888888888888&redirect_uri=http://mascot.duapp.com/oauth2.php&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirec