From 396a8f36cecffc1e2ee091da7d423df34bb1fe26 Mon Sep 17 00:00:00 2001 From: pengda <1111@qq.com> Date: Mon, 1 Sep 2025 17:30:18 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=AF=BC=E8=88=AA=E6=8E=A5=E5=85=A5?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 3 +++ src/utils/login.js | 1 + 2 files changed, 4 insertions(+) diff --git a/src/App.vue b/src/App.vue index 9f8fcd7..4406ab9 100755 --- a/src/App.vue +++ b/src/App.vue @@ -36,6 +36,7 @@ import Breadcrumb from './components/Breadcrumb.vue'; // import loadingAnimation from '@/assets/loadingAni.json' // 导入JSON文件 import GlobalLoading from '@/components/GlobalLoading1.vue' import SliderScondThree from '@/components/SliderScondThree.vue' +import store from "@/store"; // import ContentWithLoading from '@/components/ContentWithLoading' export default { data() { @@ -57,6 +58,8 @@ export default { }, mounted() { window.addEventListener('beforeunload', this.clearStorage); + const menu_list = JSON.parse(localStorage.getItem('menu_list')) + store.commit('SET_SLIDER_MENU', menu_list); console.log(this.secondMenu,'secondMenu===='); }, beforeUnmount() { diff --git a/src/utils/login.js b/src/utils/login.js index 7e1a363..171c900 100644 --- a/src/utils/login.js +++ b/src/utils/login.js @@ -31,6 +31,7 @@ export async function autoLoginByToken(timeout = 10000) { // 存入 localStorage if(res.data.data.access_token) localStorage.setItem('token', res.data.data.access_token) if(res.data.data.nick) localStorage.setItem('nick', res.data.data.nick) + if(res.data.data.menu_list) localStorage.setItem('menu_list', JSON.stringify(res.data.data.menu_list)) } const res = await axiosWithTimeout( From 5c5cd996f4e146fc53c0717022d6fe3c319cbe4b Mon Sep 17 00:00:00 2001 From: pengda <1111@qq.com> Date: Tue, 2 Sep 2025 10:18:29 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=AF=BC=E8=88=AA=E6=8E=A5=E5=85=A5?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index 1e540f7..23dffc5 100755 --- a/src/router/index.js +++ b/src/router/index.js @@ -560,9 +560,9 @@ router.beforeEach((to, from, next) => { // 一级页面 侧边栏显示 统一化 if (first_child_router.length > 0) { first_child_router.forEach(item => { - if (item.path == to.path) { + if (item.path === to.path) { store.commit('SET_CUSTOMIZE', false); - store.commit('SET_SLIDER_MENU', 'menuData'); + // store.commit('SET_SLIDER_MENU', 'menuData'); } }) } From e7ce53bbd4b39e6fc4a96e22099b9c57c8abf794 Mon Sep 17 00:00:00 2001 From: pengda <1111@qq.com> Date: Tue, 2 Sep 2025 10:21:51 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=AF=BC=E8=88=AA=E6=8E=A5=E5=85=A5?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 6 +++--- src/router/index.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/App.vue b/src/App.vue index 4406ab9..662c818 100755 --- a/src/App.vue +++ b/src/App.vue @@ -36,7 +36,7 @@ import Breadcrumb from './components/Breadcrumb.vue'; // import loadingAnimation from '@/assets/loadingAni.json' // 导入JSON文件 import GlobalLoading from '@/components/GlobalLoading1.vue' import SliderScondThree from '@/components/SliderScondThree.vue' -import store from "@/store"; +// import store from "@/store"; // import ContentWithLoading from '@/components/ContentWithLoading' export default { data() { @@ -58,8 +58,8 @@ export default { }, mounted() { window.addEventListener('beforeunload', this.clearStorage); - const menu_list = JSON.parse(localStorage.getItem('menu_list')) - store.commit('SET_SLIDER_MENU', menu_list); + // const menu_list = JSON.parse(localStorage.getItem('menu_list')) + // store.commit('SET_SLIDER_MENU', menu_list); console.log(this.secondMenu,'secondMenu===='); }, beforeUnmount() { diff --git a/src/router/index.js b/src/router/index.js index 23dffc5..900373b 100755 --- a/src/router/index.js +++ b/src/router/index.js @@ -562,7 +562,7 @@ router.beforeEach((to, from, next) => { first_child_router.forEach(item => { if (item.path === to.path) { store.commit('SET_CUSTOMIZE', false); - // store.commit('SET_SLIDER_MENU', 'menuData'); + store.commit('SET_SLIDER_MENU', 'menuData'); } }) }