模式一: 扫码后 redirect_uri 不返回code state参数, 待研究
模式二:
1.在页面中先引入如下JS文件(支持https):
<script src="http://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js"></script>
2.在需要使用微信登录的地方实例以下JS对象:
例:
var obj = new WxLogin({
id: "login_container",
appid: "*********",
scope: "snsapi_login",
redirect_uri: encodeURIComponent("http://路径/wxlogin.php"),
state: Math.ceil(Math.random()*1000),
style: "black",
href: ""
});
html例:
<div style="display:none"><div id="login_container" ></div></div>