Browse Source

登录404wenti

liuxiaona 2 years ago
parent
commit
4638b97344

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

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

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

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

+ 2 - 0
project/src/main.js

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

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

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
 const customManage = () => import(/* webpackChunkName: 'customManage' */ '@/components/customManage/manage.vue')
8
 const customManage = () => import(/* webpackChunkName: 'customManage' */ '@/components/customManage/manage.vue')
6
 const employee_bulk_messaging_log = () => import(/* webpackChunkName: 'employee_bulk_messaging_log' */ '@/components/customOperate/employee_bulk_messaging_log.vue')
9
 const employee_bulk_messaging_log = () => import(/* webpackChunkName: 'employee_bulk_messaging_log' */ '@/components/customOperate/employee_bulk_messaging_log.vue')
7
 const chatGroup = () => import(/* webpackChunkName: 'chatGroup' */ '@/components/customOperate/chatGroup/index.vue')
10
 const chatGroup = () => import(/* webpackChunkName: 'chatGroup' */ '@/components/customOperate/chatGroup/index.vue')