- https://mp.weixin.qq.com/ 微信公众平台,用公众号登录
设置公众测试号
- 登录公众平台 https://mp.weixin.qq.com/
![在这里插入图片描述](https://img-blog.csdnimg.cn/0b652a5606904c688a57420e3215de73.png
项目中去使用
bindwxFirst() {
if (this.openId) return;
// 正式号
window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx45c68621dfa44644
&redirect_uri=${encodeURIComponent(window.location.href)}
&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`
// 测试号
window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxe4055b9cea1391ce
&redirect_uri=${encodeURIComponent('https://www.qw5599.com')}
&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`
},