From fa354866ea04f7229f25e0786cd9140acc8741a9 Mon Sep 17 00:00:00 2001 From: Azir <79054161+Azir-11@users.noreply.github.com> Date: Fri, 1 Mar 2024 09:51:09 +0800 Subject: [PATCH] fix(projects): Fix the logic of root route redirection to home MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 现在在静态路由下如果修改了home,进入/还是会重定向至/home,而不是用户定义的新home --- src/router/routes/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/router/routes/index.ts b/src/router/routes/index.ts index a2b9f4b7..3749e17a 100644 --- a/src/router/routes/index.ts +++ b/src/router/routes/index.ts @@ -6,7 +6,7 @@ import { transformElegantRoutesToVueRoutes } from '../elegant/transform'; export const ROOT_ROUTE: CustomRoute = { name: 'root', path: '/', - redirect: '/home', + redirect: import.meta.env.VITE_ROUTE_HOME || '/home', meta: { title: 'root', constant: true