From 207150623eca95211a4e2d0b2a24c7e5ccd7e375 Mon Sep 17 00:00:00 2001 From: zclzone Date: Wed, 21 Feb 2024 10:04:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E8=B7=AF=E7=94=B1=E6=B2=A1=E6=9C=89=E8=80=83=E8=99=91=20base?= =?UTF-8?q?=20=E8=B7=AF=E5=BE=84=E9=97=AE=E9=A2=98,=20close=20#70?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/router/index.js b/src/router/index.js index de22792..3d78462 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -14,7 +14,9 @@ import { basicRoutes } from './basic-routes' export const router = createRouter({ history: - import.meta.env.VITE_USE_HASH === 'true' ? createWebHashHistory('/') : createWebHistory('/'), + import.meta.env.VITE_USE_HASH === 'true' + ? createWebHashHistory(import.meta.env.VITE_PUBLIC_PATH || '/') + : createWebHistory(import.meta.env.VITE_PUBLIC_PATH || '/'), routes: basicRoutes, scrollBehavior: () => ({ left: 0, top: 0 }), })