Kaynağa Gözat

去掉路由守卫

guhongwei324 7 ay önce
ebeveyn
işleme
b9875119fd
1 değiştirilmiş dosya ile 12 ekleme ve 12 silme
  1. 12 12
      src/router/index.js

+ 12 - 12
src/router/index.js

@@ -46,16 +46,16 @@ const web = [
 ];
 const routes = [...web];
 const router = new VueRouter({ mode: 'history', base: process.env.BASE_URL, routes });
-router.beforeEach((to, from, next) => {
-  document.title = `${to.meta.title} `;
-  const token = sessionStorage.getItem('token');
-  if (token) {
-    let user = jwt.decode(token);
-    store.commit('setUser', user, { root: true });
-    next();
-  } else {
-    if (to.meta.is_filter) next('/login');
-    else next();
-  }
-});
+// router.beforeEach((to, from, next) => {
+//   document.title = `${to.meta.title} `;
+//   const token = sessionStorage.getItem('token');
+//   if (token) {
+//     let user = jwt.decode(token);
+//     store.commit('setUser', user, { root: true });
+//     next();
+//   } else {
+//     if (to.meta.is_filter) next('/login');
+//     else next();
+//   }
+// });
 export default router;