瀏覽代碼

解除注释

zy1125 1 年之前
父節點
當前提交
149bf3a0e4
共有 1 個文件被更改,包括 8 次插入8 次删除
  1. 8 8
      src/router/index.js

+ 8 - 8
src/router/index.js

@@ -21,13 +21,13 @@ const router = createRouter({
21 21
 })
22 22
 
23 23
 
24
-// router.beforeEach(function(to, from, next) {
25
-//   if (!localStorage.getItem("myAdminToken")) {
26
-//       if (to.path !== '/login') {
27
-//           return next('/login')
28
-//       }
29
-//   }
30
-//   next()
31
-// })
24
+router.beforeEach(function(to, from, next) {
25
+  if (!localStorage.getItem("myAdminToken")) {
26
+      if (to.path !== '/login') {
27
+          return next('/login')
28
+      }
29
+  }
30
+  next()
31
+})
32 32
 
33 33
 export default router