feat:测试
This commit is contained in:
@@ -13,6 +13,7 @@ const code = ref(route.query.code);
|
|||||||
const type = ref(route.query.state);
|
const type = ref(route.query.state);
|
||||||
|
|
||||||
const message = ref("");
|
const message = ref("");
|
||||||
|
const scheme = ref("");
|
||||||
watch(
|
watch(
|
||||||
() => code.value,
|
() => code.value,
|
||||||
async (val) => {
|
async (val) => {
|
||||||
@@ -20,12 +21,21 @@ watch(
|
|||||||
// 使用正则表达式提取路由参数
|
// 使用正则表达式提取路由参数
|
||||||
const regex = /\/auth\/([\w-]+)[?]?/;
|
const regex = /\/auth\/([\w-]+)[?]?/;
|
||||||
const result = regex.exec(route.fullPath);
|
const result = regex.exec(route.fullPath);
|
||||||
const authParam = result != null ? result[1].toUpperCase() : null;
|
const authParam = result != null ? result[1] : null;
|
||||||
console.log(type.value, "类型");
|
switch (authParam) {
|
||||||
|
case "gitee":
|
||||||
|
scheme.value = "Gitee";
|
||||||
|
break;
|
||||||
|
case "qq":
|
||||||
|
scheme.value = "QQ";
|
||||||
|
break;
|
||||||
|
}
|
||||||
if (type.value === "0") {
|
if (type.value === "0") {
|
||||||
const res = await authOtherLogin({ code: val }, authParam);
|
const res = await authOtherLogin({ code: val }, scheme.value);
|
||||||
|
console.log(res, "登录的");
|
||||||
} else if (type.value === "1") {
|
} else if (type.value === "1") {
|
||||||
const res = await authOtherBind({ code: val }, authParam);
|
const res = await authOtherBind({ code: val }, scheme.value);
|
||||||
|
console.log(res, "绑定的");
|
||||||
}
|
}
|
||||||
message.value = "授权成功";
|
message.value = "授权成功";
|
||||||
// window.close();
|
// window.close();
|
||||||
|
|||||||
Reference in New Issue
Block a user