From 02cc47f0d4bfee7f9da0eca5a6ad8577870d2dc2 Mon Sep 17 00:00:00 2001 From: pengda <1111@qq.com> Date: Tue, 2 Sep 2025 17:33:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E8=88=AA=E5=85=BC=E5=AE=B9bug?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 5 ----- src/router/index.js | 5 ++++- src/utils/request.js | 4 ++++ 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/App.vue b/src/App.vue index 5c00d4b..9f8fcd7 100755 --- a/src/App.vue +++ b/src/App.vue @@ -36,7 +36,6 @@ 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() { @@ -58,10 +57,6 @@ export default { }, mounted() { window.addEventListener('beforeunload', this.clearStorage); - if(this.$route.path.includes('/agent/') || this.$route.path === '/'){ - 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..8bab1be 100755 --- a/src/router/index.js +++ b/src/router/index.js @@ -562,7 +562,10 @@ 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'); + + const menu_list = JSON.parse(localStorage.getItem('menu_list')) + if(menu_list) store.commit('SET_SLIDER_MENU', menu_list); } }) } diff --git a/src/utils/request.js b/src/utils/request.js index 67017ac..d13fa9f 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -50,6 +50,10 @@ service.interceptors.response.use( // 对响应错误做些什么 if (error.response) { switch (error.response.status) { + case 400: + //无权限 + window.location.href = '/'; + break; case 401: // 未授权,跳转到登录页 // window.location.href = process.env.VUE_APP_HOST;