From d288a54108071c7258fd0d4b0ff202b942b023a6 Mon Sep 17 00:00:00 2001 From: Silent YANG Date: Sun, 28 Jul 2024 20:06:52 +0800 Subject: [PATCH] update --- .env.development | 3 ++- .env.production | 1 + src/App.vue | 2 +- src/main.ts | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.env.development b/.env.development index da49af7..1c29065 100644 --- a/.env.development +++ b/.env.development @@ -1 +1,2 @@ -VITE_API_BASE_URL= 'http://localhost:8080' \ No newline at end of file +VITE_API_BASE_URL= 'http://localhost:8080' +VITE_METER_SITE = '' diff --git a/.env.production b/.env.production index e69de29..b2e25fc 100644 --- a/.env.production +++ b/.env.production @@ -0,0 +1 @@ +VITE_METER_SITE = 'k5.vicicode.com,k5.vicicode.cn,k5.lhw711.cn,mm.md,k5.mm.md' diff --git a/src/App.vue b/src/App.vue index 8faddc9..5ee587d 100644 --- a/src/App.vue +++ b/src/App.vue @@ -35,7 +35,7 @@ window.TextDecoder = TextDecoder; // 遥测 - if(location.hostname == 'k5.vicicode.com' || location.hostname == 'k5.vicicode.cn' || location.hostname == 'k5.lhw711.cn' || location.hostname == 'mm.md' || location.hostname == 'k5.mm.md'){ + if(import.meta.env.VITE_METER_SITE.split(',').indexOf(location.hostname) !== -1){ const aegis = new Aegis({ id: 'yr5DeslJkz3Qn20jg0', // 上报 id reportApiSpeed: true, // 接口测速 diff --git a/src/main.ts b/src/main.ts index 702680f..a961cdd 100644 --- a/src/main.ts +++ b/src/main.ts @@ -39,7 +39,7 @@ app.use(i18n); app.use(globalComponents); app.use(directive); -if(location.hostname == 'k5.vicicode.com' || location.hostname == 'k5.vicicode.cn' || location.hostname == 'k5.lhw711.cn' || location.hostname == 'mm.md' || location.hostname == 'k5.mm.md'){ +if(import.meta.env.VITE_METER_SITE.split(',').indexOf(location.hostname) !== -1){ app.use(VueMatomo, { host: '//analytics.vicicode.com', siteId: 2,