Skip to content

Commit

Permalink
fix: 修复三级以上路由页面无法缓存的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
greper committed Jun 8, 2024
1 parent 63c22fd commit c11f073
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ const router = createRouter({
router.beforeEach(async (to, from, next) => {
// 进度条
NProgress.start();

// 修复三级以上路由页面无法缓存的问题
if (to.matched && to.matched.length > 2) {
to.matched.splice(1, to.matched.length - 2);
}
// 验证当前路由所有的匹配中是否需要有登录验证的
if (
to.matched.some((r) => {
Expand Down

0 comments on commit c11f073

Please sign in to comment.