瀏覽代碼

add baidu ajax pageview

Michael Wang 6 年之前
父節點
當前提交
dc678be107
共有 1 個文件被更改,包括 5 次插入0 次删除
  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 {