xinfeng пре 5 година
родитељ
комит
f4116e86aa
1 измењених фајлова са 8 додато и 7 уклоњено
  1. 8 7
      plugins/router.js

+ 8 - 7
plugins/router.js

@@ -1,11 +1,6 @@
-export default ({
-  app,
-  store
-}) => {
+export default ({ app, store }) => {
   if (process.client) {
-    const {
-      host
-    } = location || {}
+    const { host } = location || {}
     const isKaifain = host.indexOf('kaifain') !== -1
     const isJishuin = host.indexOf('jishuin') !== -1
     const isJob = host.indexOf('job') !== -1
@@ -119,5 +114,11 @@ export default ({
     }
 
     console.log('router', app.router)
+    
+    app.router.beforeEach((to, from, next)=> {
+      console.log("location.href", to, from)
+      next()
+    })
+    
   }
 }