From 4076c14a8eac96cd716522f2cb15dcda0eb4fcef Mon Sep 17 00:00:00 2001 From: 马宇豪 <978517621@qq.com> Date: 星期三, 10 四月 2024 08:37:53 +0800 Subject: [PATCH] 新修改 --- src/router/index.ts | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/router/index.ts b/src/router/index.ts index 38316aa..784be70 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -75,7 +75,8 @@ NProgress.done(); } else { if (!token) { - next(`/login?redirect=${to.path}¶ms=${JSON.stringify(to.query ? to.query : to.params)}`); + // next(`/login?redirect=${to.path}¶ms=${JSON.stringify(to.query ? to.query : to.params)}`); + next(`/login`); Session.clear(); NProgress.done(); // next() @@ -85,7 +86,7 @@ } else { const storesRoutesList = useRoutesList(pinia); const { routesList } = storeToRefs(storesRoutesList); - if (routesList.value.length === 0) { + if ( routesList.value && routesList.value.length === 0) { // 后端控制路由:路由数据初始化,防止刷新时丢失 await initBackEndControlRoutes(); // 动态添加路由:防止非首页刷新时跳转回首页的问题 -- Gitblit v1.9.2