官方:https://developers.weixin.qq.com/doc/oplatform/Website_App/WeChat_Login/Wechat_Login.html
首先需要去平台注册、才可以进行下面操作:
根据下面的方法可进行直接操作:
encodeURI()是进行编码
重新定向网页
const appid = 'xxxxxxxx'
const redirect_uri = encodeURI('http://xxx.com')
const url = 'https://open.weixin.qq.com/connect/qrconnect?appid='+appid+'&redirect_uri='+redirect_uri+'&response_type=code&scope=snsapi_login#wechat_redirect'