Browse Source

解除注释

zy1125 1 year ago
parent
commit
149bf3a0e4
1 changed files with 8 additions and 8 deletions
  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) {
24
+router.beforeEach(function(to, from, next) {
25
-//   if (!localStorage.getItem("myAdminToken")) {
25
+  if (!localStorage.getItem("myAdminToken")) {
26
-//       if (to.path !== '/login') {
26
+      if (to.path !== '/login') {
27
-//           return next('/login')
27
+          return next('/login')
28
-//       }
28
+      }
29
-//   }
29
+  }
30
-//   next()
30
+  next()
31
-// })
31
+})
32
 
32
 
33
 export default router
33
 export default router