From 1d5af53e1ad904b17438396b708c832d78bc3421 Mon Sep 17 00:00:00 2001 From: juzi <819872918@qq.com> Date: Tue, 10 Mar 2026 08:53:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=83=E9=99=90=E8=B7=B3=E8=BD=AC=E4=BF=AE?= =?UTF-8?q?=E6=94=B9+=E9=A2=84=E7=AE=97=E5=A1=AB=E6=8A=A5=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/permission.js | 2 +- src/store/modules/permission.js | 3 +++ src/views/home/components/budgetDetails.vue | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/permission.js b/src/permission.js index e915f903..2411ca6a 100644 --- a/src/permission.js +++ b/src/permission.js @@ -66,7 +66,7 @@ router.beforeEach((to, from, next) => { // 根据 roles 权限生成可访问的路由表 router.addRoutes(accessRoutes) // 动态添加可访问路由表 const defaultPath = findDefaultPathFromMenus(userInfo.menus) || '/' - store.commit('permission/SET_DEFAULT_PATH', defaultPath) + store.dispatch('SetDefaultPath', defaultPath) // 仅当目标为根路径 '/' 时跳默认页;否则保持当前路径(含刷新场景),避免刷新被误判为“未匹配”而跳到默认页 if (to.path === '/') { next({ path: defaultPath, replace: true }) diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js index b54b1531..e27c05ea 100644 --- a/src/store/modules/permission.js +++ b/src/store/modules/permission.js @@ -52,6 +52,9 @@ const permission = { commit('SET_TOPBAR_ROUTES', sidebarRoutes) resolve(rewriteRoutes) }) + }, + SetDefaultPath({commit}, path) { + commit('SET_DEFAULT_PATH', path) } } } diff --git a/src/views/home/components/budgetDetails.vue b/src/views/home/components/budgetDetails.vue index 486ded68..bf6b600f 100644 --- a/src/views/home/components/budgetDetails.vue +++ b/src/views/home/components/budgetDetails.vue @@ -316,6 +316,7 @@ export default { this.getDataPage(); }); this.$modal.msgSuccess("保存成功"); + this.$emit('updateLeft') }).catch(() => { }); }, // 请求下拉数据和表格数据(使用动态切换的getDataList接口)