From 9fe1d7dea11b9ec134b779523e40467edbdfd74c Mon Sep 17 00:00:00 2001 From: piexlmax <303176530@qq.com> Date: Sun, 26 Dec 2021 23:11:50 +0800 Subject: [PATCH] fixed: #825 --- web/src/permission.js | 3 +-- web/src/view/layout/index.vue | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/web/src/permission.js b/web/src/permission.js index 152803b3..6a301477 100644 --- a/web/src/permission.js +++ b/web/src/permission.js @@ -18,7 +18,7 @@ async function handleKeepAlive(to) { if (to.matched && to.matched.length > 2) { for (let i = 1; i < to.matched.length; i++) { const element = to.matched[i - 1] - if (element.name === "layout") { + if (element.name === 'layout') { to.matched.splice(i, 1) await handleKeepAlive(to) } @@ -32,7 +32,6 @@ async function handleKeepAlive(to) { } router.beforeEach(async(to, from, next) => { - to.meta.matcheds =JSON.parse(JSON.stringify(to.matched)) handleKeepAlive(to) const token = store.getters['user/token'] // 在白名单中的判断情况 diff --git a/web/src/view/layout/index.vue b/web/src/view/layout/index.vue index 7f82aca4..d24cc171 100644 --- a/web/src/view/layout/index.vue +++ b/web/src/view/layout/index.vue @@ -152,7 +152,7 @@ export default { return this.$route.meta.title || '当前页面' }, matched() { - return this.$route.meta.matcheds + return this.$route.matched } }, created() {