From 74a697d47825f211d47139e6d64e8bb0068e61b5 Mon Sep 17 00:00:00 2001 From: qiufeng Date: Mon, 27 Oct 2025 12:01:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3gitee=E7=BB=91?= =?UTF-8?q?=E5=AE=9Aurl=E6=9B=BF=E6=8D=A2=E5=90=8E=EF=BC=8C=E8=B7=AF?= =?UTF-8?q?=E7=94=B1=E5=8F=82=E6=95=B0=E6=9C=AA=E6=B8=85=E7=A9=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/stores/src/modules/MultipleTab.ts | 2 +- src/views/sys/account/setting/SecureSetting.vue | 17 ++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/packages/stores/src/modules/MultipleTab.ts b/packages/stores/src/modules/MultipleTab.ts index ef964a78..8cd344b3 100644 --- a/packages/stores/src/modules/MultipleTab.ts +++ b/packages/stores/src/modules/MultipleTab.ts @@ -120,7 +120,7 @@ export const useMultipleTabStore = defineStore("app-multiple-tab", { // Existing pages, do not add tabs repeatedly const tabHasExits = this.tabList.some((tab, index) => { updateIndex = index; - return (tab.fullPath || tab.path) === (fullPath || path); + return tab.fullPath === fullPath || tab.path === path; }); // If the tab already exists, perform the update operation if (tabHasExits) { diff --git a/src/views/sys/account/setting/SecureSetting.vue b/src/views/sys/account/setting/SecureSetting.vue index 4569e6f9..257bd386 100644 --- a/src/views/sys/account/setting/SecureSetting.vue +++ b/src/views/sys/account/setting/SecureSetting.vue @@ -35,6 +35,9 @@ import { getSecureSetting, SsoUser, unbindGitee, unbindGithub } from "@mfish/core/api"; import { giteeConfig, githubConfig } from "@mfish/core/settings/LoginSetting"; import { defHttp } from "@mfish/core/utils/http/axios"; + import { useRoute } from "vue-router"; + import { router } from "@mfish/core/router"; + import { CollapseContainer } from "@mfish/core/components/Container"; const AListItem = AList.Item; const AListItemMeta = AListItem.Meta; @@ -83,14 +86,11 @@ icon: userInfo.value?.github ? "ant-design:stop-outlined" : "ant-design:link-outlined" } ]); - + const route = useRoute(); onBeforeMount(() => { - //此处不从路由取参数,而是从url参数取callback和code - //因为后面clearUrl只修改了链接未清除路由参数,如果清除路由参数会造成页面刷新,无法返回安全设置页面 - const params = new URLSearchParams(globalThis.location.search); - const callback = params.get("callback"); + const callback = route.query?.callback as string; if (callback === "gitee") { - const code = params.get("code"); + const code = route.query?.code as string; defHttp .put({ url: `/oauth2/gitee/bind/${code}` }) .then((res) => { @@ -104,7 +104,7 @@ return; } if (callback === "github") { - const code = params.get("code"); + const code = route.query?.code as string; defHttp .put({ url: `/oauth2/github/bind/${code}` }) .then((res) => { @@ -119,8 +119,7 @@ }); function clearUrl() { - const { pathname } = globalThis.location; - globalThis.history.replaceState({}, "", pathname); + router.replace({ query: {} }); } onMounted(() => {