Explorar o código

add baidu ajax pageview

Michael Wang %!s(int64=6) %!d(string=hai) anos
pai
achega
dc678be107
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      src/router.js

+ 5 - 0
src/router.js

@@ -83,6 +83,11 @@ let router = new Router({
 
 router.beforeEach((to, from, next) => {
   const loginPath = "/login/" + localStorage.getItem("domain");
+
+  if (to.path) {
+    window._hmt.push(["_trackPageview", to.fullPath]);
+  }
+
   if (to.path.match(/^\/login\/.+$/)) {
     next();
   } else {