增加访问埋点
This commit is contained in:
@@ -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
|
||||
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user