From 0e155e719a4894289015eed6f31b3274a312450a Mon Sep 17 00:00:00 2001 From: zhoujunhong <1298308460@qq.com> Date: Tue, 15 Oct 2024 13:42:00 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=8F=9C=E5=8D=95=E9=9A=90=E8=97=8F?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/layout/components/Sidebar/index.vue | 7 +++++++ frontend/src/views/setting/panel/index.vue | 11 +++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/frontend/src/layout/components/Sidebar/index.vue b/frontend/src/layout/components/Sidebar/index.vue index cf2722c46..43250241c 100644 --- a/frontend/src/layout/components/Sidebar/index.vue +++ b/frontend/src/layout/components/Sidebar/index.vue @@ -130,6 +130,13 @@ function getCheckedLabels(json: Node): string[] { const search = async () => { const res = await getSettingInfo(); const json: Node = JSON.parse(res.data.xpackHideMenu); + if (json.isCheck === false) { + json.children.forEach((child: any) => { + if (child.isCheck === true) { + child.isCheck = false; + } + }); + } const checkedLabels = getCheckedLabels(json); let rstMenuList: RouteRecordRaw[] = []; menuStore.menuList.forEach((item) => { diff --git a/frontend/src/views/setting/panel/index.vue b/frontend/src/views/setting/panel/index.vue index a4ad8f896..b9b59b0c3 100644 --- a/frontend/src/views/setting/panel/index.vue +++ b/frontend/src/views/setting/panel/index.vue @@ -264,8 +264,6 @@ const search = async () => { form.complexityVerification = res.data.complexityVerification; form.defaultNetwork = res.data.defaultNetwork; form.defaultNetworkVal = res.data.defaultNetwork === 'all' ? i18n.t('commons.table.all') : res.data.defaultNetwork; - form.proHideMenus = res.data.xpackHideMenu; - form.hideMenuList = res.data.xpackHideMenu; form.developerMode = res.data.developerMode; form.proxyUrl = res.data.proxyUrl; @@ -277,6 +275,15 @@ const search = async () => { form.proxyPasswdKeep = res.data.proxyPasswdKeep; const json: Node = JSON.parse(res.data.xpackHideMenu); + if (json.isCheck === false) { + json.children.forEach((child: any) => { + if (child.isCheck === true) { + child.isCheck = false; + } + }); + } + form.proHideMenus = JSON.stringify(json); + form.hideMenuList = JSON.stringify(json); const checkedTitles = getCheckedTitles(json); form.proHideMenus = checkedTitles.toString();