feat:重复绑定根据状态码关闭窗口

This commit is contained in:
Xwen
2024-01-10 22:01:23 +08:00
parent 2c8d579668
commit ce667a9f9e
3 changed files with 24 additions and 9 deletions

View File

@@ -31,12 +31,20 @@ watch(
scheme.value = "QQ";
break;
}
if (type.value === "0") {
const { data } = await authOtherLogin({ code: val }, scheme.value);
authData.value = data;
} else if (type.value === "1") {
const { data } = await authOtherBind({ code: val }, scheme.value);
authData.value = data;
try {
if (type.value === "0") {
const { data } = await authOtherLogin({ code: val }, scheme.value);
authData.value = data;
} else if (type.value === "1") {
const { data } = await authOtherBind({ code: val }, scheme.value);
authData.value = data;
}
} catch (error) {
if (error.status === 403) {
setTimeout(() => {
window.close();
}, 3000);
}
}
window.opener.postMessage({
authData: JSON.stringify(authData.value),