From f9550fe7346411a1f5e86d7f593255d8b1f2d714 Mon Sep 17 00:00:00 2001 From: dataeaseShu <106045316+dataeaseShu@users.noreply.github.com> Date: Sun, 25 Jun 2023 10:32:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BB=AA=E8=A1=A8=E6=9D=BF=E5=90=8E?= =?UTF-8?q?=E9=80=80=E5=88=B0=E7=B3=BB=E7=BB=9F=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?=E4=BE=A7=E8=BE=B9=E6=A0=8F=E6=98=BE=E7=A4=BAbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/permission.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/frontend/src/permission.js b/frontend/src/permission.js index efcede886b..3358904ec1 100644 --- a/frontend/src/permission.js +++ b/frontend/src/permission.js @@ -93,6 +93,17 @@ router.beforeEach(async (to, from, next) => routeBefore(() => { if (hasGetUserInfo || to.path.indexOf('/previewScreenShot/') > -1 || to.path.indexOf('/preview/') > -1 || to.path.indexOf('/delink') > -1 || to.path.indexOf('/nolic') > -1) { next() store.dispatch('permission/setCurrentPath', to.path) + let route = store.getters.permission_routes.find( + item => item.path === '/' + to.path.split('/')[1] + ) + // 如果找不到这个路由,说明是首页 + if (!route) { + route = store.getters.permission_routes.find(item => item.path === '/') + } + store.commit('permission/SET_CURRENT_ROUTES', route) + if (['system'].includes(route.name)) { + store.dispatch('app/toggleSideBarHide', false) + } } else { if (store.getters.roles.length === 0) { // 判断当前用户是否已拉取完user_info信息 // get user info