no message
This commit is contained in:
parent
1138eac28f
commit
e0af963c4a
2
dist/index.html
vendored
2
dist/index.html
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
21
src/App.vue
21
src/App.vue
@ -17,7 +17,26 @@ export default {
|
|||||||
socketTask: null,
|
socketTask: null,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {},
|
watch: {
|
||||||
|
// "$route": {
|
||||||
|
// handler(to, from) {
|
||||||
|
// console.log("1111111");
|
||||||
|
// //避免首次获取不到window._czc
|
||||||
|
// if (window._czc) {
|
||||||
|
// let location = window.location
|
||||||
|
// let contentUrl = location.pathname + location.hash
|
||||||
|
// let refererUrl = "/"
|
||||||
|
|
||||||
|
// window._czc.push(["_trackPageview", contentUrl, refererUrl])
|
||||||
|
// window._czc.push(["_setAutoPageview", false])
|
||||||
|
// }
|
||||||
|
// if (window._hmt) {
|
||||||
|
// if (to["path"]) window._hmt.push(["_trackPageview", to["fullPath"]])
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// // immediate: true, // 首次进入页面即执行
|
||||||
|
// },
|
||||||
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// console.log(new Date());
|
// console.log(new Date());
|
||||||
this.$store.dispatch("fetchHistoricalSearch") // 获取历史搜索记录
|
this.$store.dispatch("fetchHistoricalSearch") // 获取历史搜索记录
|
||||||
|
@ -111,21 +111,29 @@ const router = new VueRouter({
|
|||||||
// base: process.env.BASE_URL,
|
// base: process.env.BASE_URL,
|
||||||
routes
|
routes
|
||||||
})
|
})
|
||||||
|
|
||||||
|
let isInitialNavigation = true
|
||||||
|
|
||||||
router.beforeEach(async (to, from, next) => {
|
router.beforeEach(async (to, from, next) => {
|
||||||
if (to.meta.title) document.title = getPageTitle(to.meta.title);
|
if (to.meta.title) document.title = getPageTitle(to.meta.title);
|
||||||
|
|
||||||
if (window._hmt) {
|
if (isInitialNavigation) {
|
||||||
if (to.path) {
|
isInitialNavigation = false
|
||||||
window._hmt.push(['_trackPageview', '/#' + to.fullPath])
|
} 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();
|
next();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user