diff --git a/package-lock.json b/package-lock.json index 77ed7b9..52eea4d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,7 @@ "dependencies": { "@arco-design/web-vue": "^2.44.7", "@vueuse/core": "^9.3.0", + "aegis-web-sdk": "^1.39.1", "axios": "^0.24.0", "dayjs": "^1.11.5", "echarts": "^5.4.0", @@ -2154,6 +2155,14 @@ "node": ">=0.4.0" } }, + "node_modules/aegis-web-sdk": { + "version": "1.39.1", + "resolved": "https://registry.npmjs.org/aegis-web-sdk/-/aegis-web-sdk-1.39.1.tgz", + "integrity": "sha512-PkMAzeekaLpo/PmfspXiHfmGwY6DfWf7xUl8hrlkmBajQti1HqKC6pHoO3gwVPDiA9Sio5abjFGDcPjxxVTcJg==", + "dependencies": { + "web-vitals": "^3.4.0" + } + }, "node_modules/ajv": { "version": "8.12.0", "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", @@ -11741,6 +11750,11 @@ "typescript": "*" } }, + "node_modules/web-vitals": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/web-vitals/-/web-vitals-3.5.2.tgz", + "integrity": "sha512-c0rhqNcHXRkY/ogGDJQxZ9Im9D19hDihbzSQJrsioex+KnFgmMzBiy57Z1EjkhX/+OjyBpclDCzz2ITtjokFmg==" + }, "node_modules/webpack-sources": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz", diff --git a/package.json b/package.json index ff910db..716c178 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "dependencies": { "@arco-design/web-vue": "^2.44.7", "@vueuse/core": "^9.3.0", + "aegis-web-sdk": "^1.39.1", "axios": "^0.24.0", "dayjs": "^1.11.5", "echarts": "^5.4.0", diff --git a/src/App.vue b/src/App.vue index 5f8222a..3b9c521 100644 --- a/src/App.vue +++ b/src/App.vue @@ -10,6 +10,18 @@ import zhCN from '@arco-design/web-vue/es/locale/lang/zh-cn'; import GlobalSetting from '@/components/global-setting/index.vue'; import useLocale from '@/hooks/locale'; + import Aegis from 'aegis-web-sdk'; + + // 遥测 + if(location.hostname == 'k5.vicicode.com'){ + const aegis = new Aegis({ + id: 'yr5DeslJkz3Qn20jg0', // 上报 id + reportApiSpeed: true, // 接口测速 + reportAssetSpeed: true, // 静态资源测速 + spa: true, // spa 应用页面跳转的时候开启 pv 计算 + hostUrl: 'https://rumt-zh.com' + }); + } const { currentLocale } = useLocale(); const locale = computed(() => { diff --git a/yarn.lock b/yarn.lock index ebeb34d..a5ea477 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1077,6 +1077,13 @@ acorn-walk@^8.1.1: resolved "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz" integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg== +aegis-web-sdk@^1.39.1: + version "1.39.1" + resolved "https://registry.npmjs.org/aegis-web-sdk/-/aegis-web-sdk-1.39.1.tgz" + integrity sha512-PkMAzeekaLpo/PmfspXiHfmGwY6DfWf7xUl8hrlkmBajQti1HqKC6pHoO3gwVPDiA9Sio5abjFGDcPjxxVTcJg== + dependencies: + web-vitals "^3.4.0" + ajv@^6.12.4: version "6.12.6" resolved "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz" @@ -5172,6 +5179,11 @@ vue-tsc@^1.0.14: "@vue/server-renderer" "3.4.15" "@vue/shared" "3.4.15" +web-vitals@^3.4.0: + version "3.5.2" + resolved "https://registry.npmjs.org/web-vitals/-/web-vitals-3.5.2.tgz" + integrity sha512-c0rhqNcHXRkY/ogGDJQxZ9Im9D19hDihbzSQJrsioex+KnFgmMzBiy57Z1EjkhX/+OjyBpclDCzz2ITtjokFmg== + webpack-sources@^3.2.3: version "3.2.3" resolved "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz"