微信扫码登录

1.引入微信js

http://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js

2.添加dom

<div class="code">
     <div id="login_container"></div>
</div>

3.初始化

var obj = new WxLogin({
                id: "login_container", //div的id
                appid: "wx108edc53efaaaaaa",
                scope: "snsapi_login", //写死snsapi_login
                redirect_uri: encodeURI("http://www.aaaaa.com/wechat?Isweixin=false"),
                state: "",
                style: "black", //二维码黑白风格
            });

 

posted @ 2021-05-31 10:04  顾小凡  阅读(386)  评论(0)    收藏  举报