diff --git a/package.json b/package.json index 89edad1..0bd3aa6 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "pinyin-pro": "^3.26.0", "roboto-fontface": "*", "typewriter-effect": "^2.21.0", + "uuid": "^9.0.1", "vue": "^3.4.31", "vuetify": "^3.8.0" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b1f7ac2..dcb427c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -29,6 +29,9 @@ importers: typewriter-effect: specifier: ^2.21.0 version: 2.21.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + uuid: + specifier: ^9.0.1 + version: 9.0.1 vue: specifier: ^3.4.31 version: 3.5.13 @@ -3229,6 +3232,10 @@ packages: util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + uuid@9.0.1: + resolution: {integrity: sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==} + hasBin: true + varint@6.0.0: resolution: {integrity: sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg==} @@ -6904,6 +6911,8 @@ snapshots: util-deprecate@1.0.2: {} + uuid@9.0.1: {} + varint@6.0.0: {} vite-plugin-pwa@1.0.0(@vite-pwa/assets-generator@1.0.0)(vite@5.4.17(sass-embedded@1.86.3)(sass@1.86.3)(terser@5.39.0))(workbox-build@7.3.0)(workbox-window@7.3.0): diff --git a/src/axios/axios.js b/src/axios/axios.js new file mode 100644 index 0000000..889a94e --- /dev/null +++ b/src/axios/axios.js @@ -0,0 +1,26 @@ +import axios from "axios"; +import { getSetting } from '@/utils/settings'; + +// 基本配置 +const axiosInstance = axios.create({ + // 可以在这里添加基础配置,例如超时时间等 + timeout: 10000, +}); + +// 请求拦截器 +axiosInstance.interceptors.request.use( + (requestConfig) => { + // 确保每次请求时都获取最新的 siteKey + const siteKey = getSetting('server.siteKey'); + if (siteKey) { + requestConfig.headers["x-site-key"] = siteKey; + } + return requestConfig; + }, + (error) => { + console.log(error); + return Promise.reject(error); + } +); + +export default axiosInstance; diff --git a/src/components/MigrationTool.vue b/src/components/MigrationTool.vue new file mode 100644 index 0000000..9dc1c6b --- /dev/null +++ b/src/components/MigrationTool.vue @@ -0,0 +1,698 @@ + + + \ No newline at end of file diff --git a/src/components/settings/SettingItem.vue b/src/components/settings/SettingItem.vue index 63b1197..95d3c45 100644 --- a/src/components/settings/SettingItem.vue +++ b/src/components/settings/SettingItem.vue @@ -35,7 +35,7 @@ @click="adjustValue(stepValue)" /> - +