Ver Código Fonte

登录404wenti

liuxiaona 2 anos atrás
pai
commit
4638b97344

+ 1 - 0
project/src/assets/config/config.js

@@ -63,6 +63,7 @@ axios.interceptors.response.use(
63 63
       delAllCookie();//清除所以的cookie
64 64
       delAllLocal();
65 65
       router.push("/login");
66
+      this.$store.commit('setIsData', undefined)
66 67
       if (sessionStorage.getItem('reload') != '1') {
67 68
         location.reload();
68 69
       }

+ 1 - 0
project/src/components/Index/header.vue

@@ -211,6 +211,7 @@ export default {
211 211
         this.$router.push({ path: '/login' })
212 212
       } else {
213 213
         this.$router.push({ path: '/login' })
214
+        this.$store.commit('setIsData', undefined)
214 215
         this.$cookie.delAllCookie()
215 216
         this.$localSelfStore.delAllLocal()
216 217
         sessionStorage.clear();

+ 2 - 0
project/src/main.js

@@ -62,6 +62,7 @@ router.beforeEach((to, from, next) => {
62 62
   if (to.meta.isLogin) {
63 63
     if (!Boolean(getCookie('isLogin'))) {
64 64
       next('/login')
65
+      this.$store.commit('setIsData', undefined)
65 66
     } else {
66 67
       next();
67 68
     }
@@ -70,6 +71,7 @@ router.beforeEach((to, from, next) => {
70 71
       //name不存在 解决未登录跳转到页面 而页面未注册的问题
71 72
       if (!Boolean(getCookie('isLogin'))) {
72 73
         next('/login')
74
+        this.$store.commit('setIsData', undefined)
73 75
       } else {
74 76
         next();
75 77
       }

+ 6 - 3
project/src/router/allRouter.js

@@ -1,7 +1,10 @@
1
-import INDEX from '@/components/Index/index.vue'
2
-import Home from '@/components/Home.vue'
3
-import homeData from '@/components/HomeData.vue'
1
+// import INDEX from '@/components/Index/index.vue'
2
+// import Home from '@/components/Home.vue'
3
+// import homeData from '@/components/HomeData.vue'
4 4
 
5
+const INDEX = () => import(/* webpackChunkName: 'INDEX' */'@/components/Index/index.vue')
6
+const Home = () => import(/* webpackChunkName: 'Home' */'@/components/Home.vue')
7
+const homeData = () => import(/* webpackChunkName: 'homeData' */'@/components/HomeData.vue')
5 8
 const customManage = () => import(/* webpackChunkName: 'customManage' */ '@/components/customManage/manage.vue')
6 9
 const employee_bulk_messaging_log = () => import(/* webpackChunkName: 'employee_bulk_messaging_log' */ '@/components/customOperate/employee_bulk_messaging_log.vue')
7 10
 const chatGroup = () => import(/* webpackChunkName: 'chatGroup' */ '@/components/customOperate/chatGroup/index.vue')