Browse Source

fix: this.$store. => store.

zhengxy 2 years ago
parent
commit
cdefc45269
2 changed files with 3 additions and 3 deletions
  1. 1 1
      project/src/assets/config/config.js
  2. 2 2
      project/src/main.js

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

@@ -63,7 +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
+      store.commit('setIsData', undefined)
67 67
       if (sessionStorage.getItem('reload') != '1') {
68 68
         location.reload();
69 69
       }

+ 2 - 2
project/src/main.js

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