From 031b7f698a71c59b739d3ebbc9da43602eca7110 Mon Sep 17 00:00:00 2001 From: xlsea Date: Mon, 16 Jun 2025 17:56:25 +0800 Subject: [PATCH] =?UTF-8?q?fix(projects):=20=E4=BF=AE=E5=A4=8D=E9=A6=96?= =?UTF-8?q?=E9=A1=B5=E6=9C=AA=E4=BB=8E=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/route/index.ts | 15 ++------------- src/views/_builtin/social-callback/index.vue | 2 +- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/store/modules/route/index.ts b/src/store/modules/route/index.ts index d45391bb..21aec092 100644 --- a/src/store/modules/route/index.ts +++ b/src/store/modules/route/index.ts @@ -42,16 +42,7 @@ export const useRouteStore = defineStore(SetupStoreId.Route, () => { const authRouteMode = ref(import.meta.env.VITE_AUTH_ROUTE_MODE); /** Home route key */ - const routeHome = ref(import.meta.env.VITE_ROUTE_HOME); - - /** - * Set route home - * - * @param routeKey Route key - */ - function setRouteHome(routeKey: LastLevelRouteKey) { - routeHome.value = routeKey; - } + const routeHome = ref(import.meta.env.VITE_ROUTE_HOME || 'home'); /** constant routes */ const constantRoutes = shallowRef([]); @@ -303,9 +294,7 @@ export const useRouteStore = defineStore(SetupStoreId.Route, () => { handleConstantAndAuthRoutes(); - setRouteHome('home'); - - handleUpdateRootRouteRedirect('home'); + handleUpdateRootRouteRedirect(routeHome.value); setIsInitAuthRoute(true); } else { diff --git a/src/views/_builtin/social-callback/index.vue b/src/views/_builtin/social-callback/index.vue index d71443df..6b16e248 100644 --- a/src/views/_builtin/social-callback/index.vue +++ b/src/views/_builtin/social-callback/index.vue @@ -31,7 +31,7 @@ const processResponse = async () => { msg.value = '登录成功,1s 后即将跳转至首页'; }, 1000); setTimeout(() => { - routerPushByKey('home'); + routerPushByKey(import.meta.env.VITE_ROUTE_HOME || 'home'); }, 1000); };