From b961659c2f5ff9d2699718645c3aae98560f3bf6 Mon Sep 17 00:00:00 2001 From: lrl <742798240@qq.com> Date: Tue, 14 Dec 2021 13:23:02 +0800 Subject: [PATCH] fix: router --- src/router/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/router/index.ts b/src/router/index.ts index e714dce7e..5378e7a87 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -111,8 +111,8 @@ router.beforeEach((to: toRouteType, _from, next) => { : router.options.routes; const route = findRouteByPath(path, routes); const routePartent = getParentPaths(path, routes); - // 未开启标签页缓存,刷新页面重定向到顶级路由(参考标签页操作例子,只针对动态路由) - if (routePartent.length === 0) { + // 未开启标签页缓存,刷新页面重定向到顶级路由(参考标签页操作例子,只针对动态路由 + if (path !== routes[0].path && routePartent.length === 0) { const { name, meta } = findRouteByPath( route?.meta?.refreshRedirect, routes