使用iframe实现微信扫码二维码显示,无需插件生成



 let redirect_uri = `回调地址`;
this.encodeReturnUrl = `https://open.weixin.qq.com/connect/qrconnect?appid=appid&
                        redirect_uri=${redirect_uri}&
                        response_type=code&
                        scope=snsapi_login&
                        state=STATE#wechat_redirect`;

获取code接口
https://open.weixin.qq.com/connect/qrconnect?appid=APPID&redirect_uri=REDIRECT_URI&response_type=code&scope=SCOPE&state=STATE#wechat_redirect

获取acess_token、openid接口
https://api.weixin.qq.com/sns/oauth2/access_token?appid=APPID&secret=SECRET&code=CODE&grant_type=authorization_code
获取用户信息接口:
https://api.weixin.qq.com/sns/userinfo?access_token=access_token&openid=openid

你可能感兴趣的:(jquery,javascript,ajax)