From 4bbe10c0db7d46123be61c879b588d328938ac53 Mon Sep 17 00:00:00 2001 From: dengbf Date: Tue, 25 Nov 2025 10:40:40 +0800 Subject: [PATCH] =?UTF-8?q?-=20[=E4=BF=AE=E5=A4=8D]=20=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E7=AE=A1=E7=90=86-=E7=9B=AE=E5=BD=95=E5=92=8C=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E9=83=BD=E6=8E=88=E6=9D=83=E7=BB=99=E6=89=80=E6=9C=89?= =?UTF-8?q?=E4=BA=BA=EF=BC=8C=E4=BD=86=E6=98=AF=E6=99=AE=E9=80=9A=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E8=AE=BF=E9=97=AE=E6=97=B6=E6=B2=A1=E6=9C=89=E7=8E=B0?= =?UTF-8?q?=E5=AE=9E=E8=8F=9C=E5=8D=95=E5=85=A5=E5=8F=A3=20=20=20-=20[?= =?UTF-8?q?=E5=85=B3=E8=81=94]=20#[1562202039877635]=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E7=AE=A1=E7=90=86-=E7=9B=AE=E5=BD=95=E5=92=8C=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E9=83=BD=E6=8E=88=E6=9D=83=E7=BB=99=E6=89=80=E6=9C=89?= =?UTF-8?q?=E4=BA=BA=EF=BC=8C=E4=BD=86=E6=98=AF=E6=99=AE=E9=80=9A=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E8=AE=BF=E9=97=AE=E6=97=B6=E6=B2=A1=E6=9C=89=E7=8E=B0?= =?UTF-8?q?=E5=AE=9E=E8=8F=9C=E5=8D=95=E5=85=A5=E5=8F=A3=20http://192.168.?= =?UTF-8?q?0.96:8090/demo/rdm.html#/bug-detail/939050947543040/93905094754?= =?UTF-8?q?3057/1562202039877635?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/components/topnav/topnav-menu.vue | 36 ++++++++------------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/src/views/components/topnav/topnav-menu.vue b/src/views/components/topnav/topnav-menu.vue index 0a9ce5d24..64307e6e2 100644 --- a/src/views/components/topnav/topnav-menu.vue +++ b/src/views/components/topnav/topnav-menu.vue @@ -75,7 +75,8 @@ export default { selectedExtraMenuList: [] // 已选的额外菜单列表。用于在点击跳转后重置选中状态,防止第二次点击无效。 }; }, - created() { + async created() { + await this.initExtramenu(); //检测hash变化,用于framework.html切换hash window.addEventListener('hashchange', this.onHashChange); //如果从别的页面进来,使用此方法检测 @@ -254,17 +255,19 @@ export default { }; }, initExtramenu() { - this.$api.framework && - this.$api.framework.extramenu - .getMenuList() - .then(res => { - this.extramenuList = res.Return; - }) - .finally(() => { - this.$nextTick(() => { - this.$store.commit('setExtramenu', false); - }); + if (!this.$api.framework) { + return; + } + return this.$api.framework.extramenu + .getMenuList() + .then(res => { + this.extramenuList = res.Return; + }) + .finally(() => { + this.$nextTick(() => { + this.$store.commit('setExtramenu', false); }); + }); } }, computed: { @@ -283,9 +286,6 @@ export default { return groupList; }; }, - isHasExtramenu() { - return this.$AuthUtils.hasRole('EXTRA_MENU_MODIFY'); - }, isUpdateExtramenu() { return this.$store.state.isUpdateExtramenu; }, @@ -296,14 +296,6 @@ export default { } }, watch: { - isHasExtramenu: { - handler(val) { - if (val) { - this.initExtramenu(); - } - }, - immediate: true - }, isUpdateExtramenu: { handler(val) { if (val) { -- Gitee