增加访问埋点

This commit is contained in:
lcc
2025-10-16 15:48:08 +08:00
parent fecde0f3c1
commit 2c7389d531
2 changed files with 18 additions and 0 deletions
+3
View File
@@ -8,6 +8,7 @@ import MyOrder from '../pages/MyOrder.vue'
import MyAllowance from '../pages/MyAllowance.vue'
import MyAllowanceForm from '../pages/MyAllowanceForm.vue'
import MyBank from '../pages/MyBank.vue'
import {sendVisitLog} from '@/utils/useStatistics'
const routes = [
{ path: '/', name: 'Home', component: Home },
@@ -33,5 +34,7 @@ router.afterEach(() => {
// arguments: [{ is_auto: false }] // 按文档要求传递固定格式参数
// })
// }
console.log("发送PV统计");
sendVisitLog();
})
export default router
+15
View File
@@ -0,0 +1,15 @@
import api from '@/utils/api'
export const sendVisitLog = (params) => {
let url = window.location.href
console.log('lcc', url)
let data = {
url,
...params
}
api.post('/auto/visit', data);
}
export default {
sendVisitLog
}