1、微信登录
function WXLogin() {
let url = "需要跳转回的URL";
if (this.check_) {
const dom = document.getElementById("checkbox_");
this.check_ = false;
window.location.href = `https://open.weixin.qq.com/connect/qrconnect?appid=wx901e99869df0daaf&redirect_uri=${url}&response_type=code&scope=snsapi_login&state=STATE#wechat_redirect`;
} else {
this.notice = "请先阅读并同意协议";
this.showNotice = true;
setTimeout(() => {
this.showNotice = false;
}, 2000);
}
}
2、QQ 登录
function QQLogin() {
let url = "需要跳转回的URL";
if (this.check_) {
const dom = document.getElementById("checkbox_");
dom.checked = false;
this.check_ = dom.checked;
window.location.href = `https://graph.qq.com/oauth2.0/authorize?response_type=code&client_id=101982828&redirect_uri=${url}&scope=get_user_info`;
} else {
this.notice = "请先阅读并同意协议";
this.showNotice = true;
setTimeout(() => {
this.showNotice = false;
}, 2000);
}
}