no message

This commit is contained in:
A1300399510
2023-12-18 11:08:45 +08:00
parent 1138eac28f
commit e0af963c4a
5 changed files with 41 additions and 14 deletions

View File

@@ -111,21 +111,29 @@ const router = new VueRouter({
// base: process.env.BASE_URL,
routes
})
let isInitialNavigation = true
router.beforeEach(async (to, from, next) => {
if (to.meta.title) document.title = getPageTitle(to.meta.title);
if (window._hmt) {
if (to.path) {
window._hmt.push(['_trackPageview', '/#' + to.fullPath])
if (isInitialNavigation) {
isInitialNavigation = false
} else {
if (window._hmt) {
if (to.path) {
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])
}
next();