chore: remove qs

This commit is contained in:
chansee97 2024-05-25 14:34:19 +08:00
parent 8419f29d84
commit 4dde8b78dd
6 changed files with 9 additions and 6 deletions

3
.env
View File

@ -12,3 +12,6 @@ VITE_HOME_PATH = /dashboard/workbench
# 本地存储前缀 # 本地存储前缀
VITE_STORAGE_PREFIX= VITE_STORAGE_PREFIX=
# 版权信息
VITE_COPYRIGHT_INFO= Copyright © 2024 chansee97

View File

@ -59,7 +59,6 @@
"performant-array-to-tree": "^1.11.0", "performant-array-to-tree": "^1.11.0",
"pinia": "^2.1.7", "pinia": "^2.1.7",
"pinia-plugin-persist": "^1.0.0", "pinia-plugin-persist": "^1.0.0",
"qs": "^6.12.1",
"quill": "^2.0.2", "quill": "^2.0.2",
"radash": "^12.1.0", "radash": "^12.1.0",
"vue": "^3.4.27", "vue": "^3.4.27",
@ -71,7 +70,6 @@
"@iconify-json/icon-park-outline": "^1.1.15", "@iconify-json/icon-park-outline": "^1.1.15",
"@iconify/vue": "^4.1.2", "@iconify/vue": "^4.1.2",
"@types/node": "^20.12.12", "@types/node": "^20.12.12",
"@types/qs": "^6.9.15",
"@vitejs/plugin-vue": "^5.0.4", "@vitejs/plugin-vue": "^5.0.4",
"@vitejs/plugin-vue-jsx": "^3.1.0", "@vitejs/plugin-vue-jsx": "^3.1.0",
"eslint": "^9.3.0", "eslint": "^9.3.0",

View File

@ -2,7 +2,6 @@ import { createAlova } from 'alova'
import VueHook from 'alova/vue' import VueHook from 'alova/vue'
import GlobalFetch from 'alova/GlobalFetch' import GlobalFetch from 'alova/GlobalFetch'
import { createServerTokenAuthentication } from '@alova/scene-vue' import { createServerTokenAuthentication } from '@alova/scene-vue'
import qs from 'qs'
import { import {
handleBusinessError, handleBusinessError,
handleRefreshToken, handleRefreshToken,
@ -52,7 +51,7 @@ export function createAlovaInstance(
beforeRequest: onAuthRequired((method) => { beforeRequest: onAuthRequired((method) => {
if (method.meta?.isFormPost) { if (method.meta?.isFormPost) {
method.config.headers['Content-Type'] = 'application/x-www-form-urlencoded' 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) alovaConfig.beforeRequest?.(method)
}), }),

View File

@ -18,7 +18,7 @@ const { system, store } = useColorMode({
export const useAppStore = defineStore('app-store', { export const useAppStore = defineStore('app-store', {
state: () => { state: () => {
return { return {
footerText: 'Copyright © 2024 chansee97', footerText: import.meta.env.VITE_COPYRIGHT_INFO,
lang: 'enUS' as App.lang, lang: 'enUS' as App.lang,
theme: themeConfig as GlobalThemeOverrides, theme: themeConfig as GlobalThemeOverrides,
primaryColor: themeConfig.common.primaryColor, primaryColor: themeConfig.common.primaryColor,
@ -77,7 +77,7 @@ export const useAppStore = defineStore('app-store', {
}, },
/* 设置主题色 */ /* 设置主题色 */
setPrimaryColor(color: string) { 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() const darkenColor = colord(color).darken(0.05).toHex()
set(this.theme, 'common.primaryColor', color) set(this.theme, 'common.primaryColor', color)
set(this.theme, 'common.primaryColorHover', brightenColor) set(this.theme, 'common.primaryColorHover', brightenColor)

View File

@ -27,6 +27,8 @@ interface ImportMetaEnv {
readonly VITE_AUTH_ROUTE_MODE: 'static' | 'dynamic' readonly VITE_AUTH_ROUTE_MODE: 'static' | 'dynamic'
/** 首次加载页面 */ /** 首次加载页面 */
readonly VITE_HOME_PATH: string readonly VITE_HOME_PATH: string
/** 版权信息 */
readonly VITE_COPYRIGHT_INFO: string
/** 后端服务的环境类型 */ /** 后端服务的环境类型 */
readonly MODE: ServiceEnvType readonly MODE: ServiceEnvType

View File

@ -10,6 +10,7 @@ const emit = defineEmits<{
async function post() { async function post() {
const params = { const params = {
data: '2022-2-2', data: '2022-2-2',
name: 'for',
} }
const res = await fetchFormPost(params) const res = await fetchFormPost(params)
emit('update', res) emit('update', res)