From 79405f8853f5b59ea25a94119f3743bc4be123b1 Mon Sep 17 00:00:00 2001 From: A1300399510 Date: Fri, 7 Jul 2023 11:20:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BB=9F=E8=AE=A1=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/index.html | 6 +++--- src/router/index.js | 22 ++++++++++++---------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/public/index.html b/public/index.html index c073aef..04fdd63 100755 --- a/public/index.html +++ b/public/index.html @@ -18,8 +18,8 @@
- - +
diff --git a/src/router/index.js b/src/router/index.js index d1544e9..181dd87 100755 --- a/src/router/index.js +++ b/src/router/index.js @@ -113,17 +113,19 @@ const router = new VueRouter({ router.beforeEach(async (to, from, next) => { if (to.meta.title) document.title = getPageTitle(to.meta.title); - var _hmt = _hmt || []; - var hm = document.createElement("script"); - hm.src = "//hm.baidu.com/hm.js?4bd66cbe45a640b607fe46c48f658746"; - var s = document.getElementsByTagName("script")[0]; - s.parentNode.insertBefore(hm, s); + if (window._hmt) { + if (to.path) { + window._hmt.push(['_trackPageview', '/#' + to.fullPath]) + } + } - var _hmt1 = _hmt1 || []; - var hm1 = document.createElement("script"); - hm1.src = "//v1.cnzz.com/z_stat.php?id=1281224882&web_id=1281224882"; - var s1 = document.getElementsByTagName("script")[0]; - s1.parentNode.insertBefore(hm1, s1); + if (window._czc) { + let location = window.location + let contentUrl = location.pathname + location.hash + let refererUrl = "/" + // 用于发送某个URL的PV统计请求 + window._czc.push(["_trackPageview", contentUrl, refererUrl]) + } next(); });