From 2c7389d5313a9c7cebb60ca46b886077b24f11ae Mon Sep 17 00:00:00 2001 From: lcc <805383944@qq.com> Date: Thu, 16 Oct 2025 15:48:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AE=BF=E9=97=AE=E5=9F=8B?= =?UTF-8?q?=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 3 +++ src/utils/useStatistics.js | 15 +++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 src/utils/useStatistics.js diff --git a/src/router/index.js b/src/router/index.js index d57aa98..e0ee006 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -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 \ No newline at end of file diff --git a/src/utils/useStatistics.js b/src/utils/useStatistics.js new file mode 100644 index 0000000..722b57e --- /dev/null +++ b/src/utils/useStatistics.js @@ -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 +} \ No newline at end of file