修改统计代码

This commit is contained in:
A1300399510 2023-12-15 11:23:33 +08:00
parent 51c7932205
commit 62677e7c81
7 changed files with 159 additions and 135 deletions

4
dist/index.html vendored
View File

@ -1,7 +1,7 @@
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="https://ansnid.oss-cn-shenzhen.aliyuncs.com/fang/favicon.ico"><title>港校租房</title><script defer="defer" src="https://ansnid.oss-cn-shenzhen.aliyuncs.com/fang/js/chunk-vendors.e0e9f2f6.js"></script><script defer="defer" src="https://ansnid.oss-cn-shenzhen.aliyuncs.com/fang/js/app.d772b454.js"></script><link href="https://ansnid.oss-cn-shenzhen.aliyuncs.com/fang/css/chunk-vendors.7885d77e.css" rel="stylesheet"><link href="https://ansnid.oss-cn-shenzhen.aliyuncs.com/fang/css/app.872c0487.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but zufang doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><script src="https://app.gter.net/bottom?tpl=header&menukey=fang"></script><div id="app"></div><div style="display:none;"><script src="//v1.cnzz.com/z_stat.php?id=1281224882&amp;web_id=1281224882"></script><script>var _hmt = _hmt || [];
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="https://ansnid.oss-cn-shenzhen.aliyuncs.com/fang/favicon.ico"><title>港校租房</title><script defer="defer" src="https://ansnid.oss-cn-shenzhen.aliyuncs.com/fang/js/chunk-vendors.e0e9f2f6.js"></script><script defer="defer" src="https://ansnid.oss-cn-shenzhen.aliyuncs.com/fang/js/app.6c4d5548.js"></script><link href="https://ansnid.oss-cn-shenzhen.aliyuncs.com/fang/css/chunk-vendors.7885d77e.css" rel="stylesheet"><link href="https://ansnid.oss-cn-shenzhen.aliyuncs.com/fang/css/app.3ce72176.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but zufang doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><script src="https://app.gter.net/bottom?tpl=header&menukey=fang"></script><div id="app"></div><div style="display:none;"><script src="//v1.cnzz.com/z_stat.php?id=1281224882&amp;web_id=1281224882"></script><script>var _hmt = _hmt || [];
(function () {
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?4bd66cbe45a640b607fe46c48f658746";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();</script></div><script src="https://app.gter.net/bottom?tpl=footer"></script></body></html>
})();</script></div></body></html>

1
dist/js/app.6c4d5548.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -31,7 +31,7 @@
</script>
</div>
<!-- built files will be auto injected -->
<script src="https://app.gter.net/bottom?tpl=footer"></script>
<!-- <script src="https://app.gter.net/bottom?tpl=footer"></script> -->
</body>

File diff suppressed because one or more lines are too long

View File

@ -131,6 +131,8 @@ const router = createRouter({
})
let isInitialNavigation = false
router.beforeEach((to, from, next) => {
//进度条开始
NProgress.start();
@ -142,20 +144,25 @@ router.beforeEach((to, from, next) => {
let title = meta['title']
if (title) setSeoTitle(title)
if (window._hmt) {
if (to.path) {
// window._hmt.push(['_trackPageview', '/#' + to.fullPath])
window._hmt.push(['_trackPageview', to.fullPath])
if (isInitialNavigation) {
isInitialNavigation = false
} else {
return
console.log("1111111,", to.path, to.fullPath);
if (window._hmt) {
if (to.path) {
// window._hmt.push(['_trackPageview', '/#' + to.fullPath])
window._hmt.push(['_trackPageview', to.fullPath])
}
}
}
if (window._czc) {
let location = window.location
let contentUrl = location.pathname + location.hash
let refererUrl = "/"
// 用于发送某个URL的PV统计请求
window._czc.push(["_trackPageview", contentUrl, refererUrl])
if (window._czc) {
let location = window.location
let contentUrl = location.pathname + location.hash
let refererUrl = "/"
// 用于发送某个URL的PV统计请求
window._czc.push(["_trackPageview", contentUrl, refererUrl])
}
}
})