From 8c7e4a6e917033a361252545edda016db3c94d73 Mon Sep 17 00:00:00 2001 From: zk Date: Tue, 21 May 2024 16:08:35 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E5=85=B3=E9=97=AD=E6=B5=8F=E8=A7=88?= =?UTF-8?q?=E5=99=A8=E6=97=B6=E7=BC=93=E5=AD=98=E5=BD=93=E5=89=8D=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/router/index.ts b/src/router/index.ts index 0cb8f65..cb34f0e 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,4 +1,5 @@ import { createRouter, createWebHistory, Router, RouteRecordRaw } from 'vue-router'; +import { setCurrentPath } from '/@/enum/pageEnum.ts'; const routes: Array = [ { @@ -60,5 +61,10 @@ const router: Router = createRouter({ history: createWebHistory('/'), routes: [...routes], }); - +router.beforeEach((to, from, next) => { + if (to.path !== '/login' && to.path !== '/screenLogin') { + setCurrentPath(to.path); + } + next(); +}); export default router;