Explorar o código

工时管家——后台百度统计

ZhouRuiTing %!s(int64=5) %!d(string=hai) anos
pai
achega
33ccef3a35
Modificáronse 1 ficheiros con 16 adicións e 2 borrados
  1. 16 2
      fhKeeper/formulahousekeeper/timesheet/src/main.js

+ 16 - 2
fhKeeper/formulahousekeeper/timesheet/src/main.js

@@ -35,7 +35,8 @@ import router from './routes'
 import NProgress from 'nprogress'
 import 'nprogress/nprogress.css'
 
-var addRouFlag = false
+var addRouFlag = false;
+
 router.beforeEach((to, from, next) => {
     NProgress.start();
     if (to.path == '/register') {
@@ -97,7 +98,20 @@ function hasPermission(route, roles) {
 }
 
 router.afterEach(() => {
-    NProgress.done()
+    NProgress.done();
+    // 百度统计
+    setTimeout(()=>{
+        var _hmt = _hmt || [];
+        (function() {
+            //每次执行前,先移除上次插入的代码
+            document.getElementById('baidu_tj') && document.getElementById('baidu_tj').remove();
+            var hm = document.createElement("script");
+            hm.src = "https://hm.baidu.com/hm.js?b485cd24e5dcbe73d4dde5abf7dc8ae0";
+            hm.id = "baidu_tj"
+            var s = document.getElementsByTagName("script")[0];
+            s.parentNode.insertBefore(hm, s);
+        })();
+    },0);
 })
 
 new Vue({