修改统计代码

This commit is contained in:
A1300399510 2023-07-07 11:20:30 +08:00
parent 261a6c61c4
commit 79405f8853
2 changed files with 15 additions and 13 deletions

View File

@ -18,8 +18,8 @@
</noscript>
<div id="app"></div>
<div style="display:none;">
<!-- <script type="text/javascript" src="//v1.cnzz.com/z_stat.php?id=1281224882&amp;web_id=1281224882"></script> -->
<!-- <script type="text/javascript">
<script type="text/javascript" src="//v1.cnzz.com/z_stat.php?id=1281224882&amp;web_id=1281224882"></script>
<script type="text/javascript">
var _hmt = _hmt || [];
(function () {
var hm = document.createElement("script");
@ -27,7 +27,7 @@
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script> -->
</script>
</div>
<!-- 这个统计代码 明天加在H5论坛页面 -->

View File

@ -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&amp;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();
});