From 66a451fc1f540ce5e4a24b31d13680c354867bbf Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Wed, 28 Feb 2024 17:06:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E7=99=BB=E9=99=86?= =?UTF-8?q?=E9=A1=B5=E5=88=B7=E6=96=B0=E8=B7=B3=E8=BD=AC=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20(#4014)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs #3739 --- frontend/src/routers/index.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/frontend/src/routers/index.ts b/frontend/src/routers/index.ts index 40d852026..9b65d9ec2 100644 --- a/frontend/src/routers/index.ts +++ b/frontend/src/routers/index.ts @@ -13,6 +13,14 @@ router.beforeEach((to, from, next) => { axiosCanceler.removeAllPending(); const globalStore = GlobalStore(); + if (to.name === 'home' && !globalStore.isLogin) { + next({ + name: 'entrance', + params: { code: globalStore.entrance }, + }); + NProgress.done(); + return; + } if (to.name === 'entrance' && globalStore.isLogin) { if (to.params.code === globalStore.entrance) { next({