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;