mirror of
https://gitee.com/hhyykk/ipms-sjy-ui.git
synced 2025-07-16 03:45:07 +08:00
Redis 菜单的重构,移除对 key 的管理
This commit is contained in:
23
src/plugins/tongji/index.ts
Normal file
23
src/plugins/tongji/index.ts
Normal file
@ -0,0 +1,23 @@
|
||||
import router from '@/router'
|
||||
|
||||
// 用于 router push
|
||||
window._hmt = window._hmt || []
|
||||
// HM_ID
|
||||
const HM_ID = import.meta.env.VITE_APP_BAIDU_CODE
|
||||
;(function () {
|
||||
// 有值的时候,才开启
|
||||
if (!HM_ID) {
|
||||
return
|
||||
}
|
||||
const hm = document.createElement('script')
|
||||
hm.src = 'https://hm.baidu.com/hm.js?' + HM_ID
|
||||
const s = document.getElementsByTagName('script')[0]
|
||||
s.parentNode.insertBefore(hm, s)
|
||||
})()
|
||||
|
||||
router.afterEach(function (to) {
|
||||
if (!HM_ID) {
|
||||
return
|
||||
}
|
||||
_hmt.push(['_trackPageview', to.fullPath])
|
||||
})
|
Reference in New Issue
Block a user