From 94325e9c2b8a03631639dbddc22ef06dc07d39aa Mon Sep 17 00:00:00 2001 From: xiaoxian521 <1923740402@qq.com> Date: Fri, 17 Dec 2021 18:29:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E8=B7=AF=E7=94=B1=E5=AD=90=E9=9B=86=E8=AE=BE=E7=BD=AErank?= =?UTF-8?q?=E4=B8=BA0=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/router/index.ts b/src/router/index.ts index 757f18b..d2fbc11 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -112,7 +112,11 @@ router.beforeEach((to: toRouteType, _from, next) => { const route = findRouteByPath(path, routes); const routePartent = getParentPaths(path, routes); // 未开启标签页缓存,刷新页面重定向到顶级路由(参考标签页操作例子,只针对动态路由) - if (path !== routes[0].path && routePartent.length === 0) { + if ( + path !== routes[0].path && + route?.meta?.rank !== 0 && + routePartent.length === 0 + ) { const { name, meta } = findRouteByPath( route?.meta?.refreshRedirect, routes