diff --git a/.env b/.env index 9889029..23f5ed5 100644 --- a/.env +++ b/.env @@ -12,3 +12,6 @@ VITE_HOME_PATH = /dashboard/workbench # 本地存储前缀 VITE_STORAGE_PREFIX= + +# 版权信息 +VITE_COPYRIGHT_INFO= Copyright © 2024 chansee97 diff --git a/package.json b/package.json index fb4b18f..4725e30 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,6 @@ "performant-array-to-tree": "^1.11.0", "pinia": "^2.1.7", "pinia-plugin-persist": "^1.0.0", - "qs": "^6.12.1", "quill": "^2.0.2", "radash": "^12.1.0", "vue": "^3.4.27", @@ -71,7 +70,6 @@ "@iconify-json/icon-park-outline": "^1.1.15", "@iconify/vue": "^4.1.2", "@types/node": "^20.12.12", - "@types/qs": "^6.9.15", "@vitejs/plugin-vue": "^5.0.4", "@vitejs/plugin-vue-jsx": "^3.1.0", "eslint": "^9.3.0", diff --git a/src/service/http/alova.ts b/src/service/http/alova.ts index c09d0db..008d993 100644 --- a/src/service/http/alova.ts +++ b/src/service/http/alova.ts @@ -2,7 +2,6 @@ import { createAlova } from 'alova' import VueHook from 'alova/vue' import GlobalFetch from 'alova/GlobalFetch' import { createServerTokenAuthentication } from '@alova/scene-vue' -import qs from 'qs' import { handleBusinessError, handleRefreshToken, @@ -52,7 +51,7 @@ export function createAlovaInstance( beforeRequest: onAuthRequired((method) => { if (method.meta?.isFormPost) { method.config.headers['Content-Type'] = 'application/x-www-form-urlencoded' - method.data = qs.stringify(method.data) + method.data = new URLSearchParams(method.data as URLSearchParams).toString() } alovaConfig.beforeRequest?.(method) }), diff --git a/src/store/app/index.ts b/src/store/app/index.ts index 4b5cc4b..a815329 100644 --- a/src/store/app/index.ts +++ b/src/store/app/index.ts @@ -18,7 +18,7 @@ const { system, store } = useColorMode({ export const useAppStore = defineStore('app-store', { state: () => { return { - footerText: 'Copyright © 2024 chansee97', + footerText: import.meta.env.VITE_COPYRIGHT_INFO, lang: 'enUS' as App.lang, theme: themeConfig as GlobalThemeOverrides, primaryColor: themeConfig.common.primaryColor, @@ -77,7 +77,7 @@ export const useAppStore = defineStore('app-store', { }, /* 设置主题色 */ setPrimaryColor(color: string) { - const brightenColor = colord(color).lighten(0.1).toHex() + const brightenColor = colord(color).lighten(0.05).toHex() const darkenColor = colord(color).darken(0.05).toHex() set(this.theme, 'common.primaryColor', color) set(this.theme, 'common.primaryColorHover', brightenColor) diff --git a/src/typings/env.d.ts b/src/typings/env.d.ts index 1c96aee..fce4e78 100644 --- a/src/typings/env.d.ts +++ b/src/typings/env.d.ts @@ -27,6 +27,8 @@ interface ImportMetaEnv { readonly VITE_AUTH_ROUTE_MODE: 'static' | 'dynamic' /** 首次加载页面 */ readonly VITE_HOME_PATH: string + /** 版权信息 */ + readonly VITE_COPYRIGHT_INFO: string /** 后端服务的环境类型 */ readonly MODE: ServiceEnvType diff --git a/src/views/demo/fetch/components/FormPost.vue b/src/views/demo/fetch/components/FormPost.vue index 64b5c04..a4a6e2e 100644 --- a/src/views/demo/fetch/components/FormPost.vue +++ b/src/views/demo/fetch/components/FormPost.vue @@ -10,6 +10,7 @@ const emit = defineEmits<{ async function post() { const params = { data: '2022-2-2', + name: 'for', } const res = await fetchFormPost(params) emit('update', res)