Browse Source

导航兼容bug修复

master
pengda 10 hours ago
parent
commit
02cc47f0d4
  1. 5
      src/App.vue
  2. 5
      src/router/index.js
  3. 4
      src/utils/request.js

5
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() {

5
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);
}
})
}

4
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;

Loading…
Cancel
Save