diff --git a/package.json b/package.json
index e4deb9a..06d2631 100644
--- a/package.json
+++ b/package.json
@@ -58,40 +58,34 @@
"md-editor-v3": "^4.11.3",
"pinia": "^2.1.7",
"pinia-plugin-persist": "^1.0.0",
- "qs": "^6.11.2",
+ "qs": "^6.12.0",
"vue": "^3.4.21",
- "vue-qr": "^4.0.9",
"vue-router": "^4.3.0"
},
"devDependencies": {
- "@antfu/eslint-config": "^2.6.4",
+ "@antfu/eslint-config": "^2.8.3",
"@iconify-json/icon-park-outline": "^1.1.15",
"@iconify/vue": "^4.1.1",
"@types/crypto-js": "^4.2.2",
- "@types/node": "^20.11.22",
+ "@types/node": "^20.11.28",
"@types/qs": "^6.9.12",
"@vitejs/plugin-vue": "^5.0.4",
"@vitejs/plugin-vue-jsx": "^3.1.0",
"eslint": "^8.57.0",
"lint-staged": "^15.2.2",
"naive-ui": "^2.38.1",
- "sass": "^1.71.1",
- "simple-git-hooks": "^2.9.0",
- "typescript": "^5.3.3",
- "unocss": "^0.58.5",
+ "sass": "^1.72.0",
+ "simple-git-hooks": "^2.10.0",
+ "typescript": "^5.4.2",
+ "unocss": "^0.58.6",
"unplugin-auto-import": "^0.17.5",
"unplugin-icons": "^0.18.5",
"unplugin-vue-components": "^0.26.0",
- "vite": "^5.1.4",
- "vite-bundle-visualizer": "^1.0.1",
+ "vite": "^5.1.6",
+ "vite-bundle-visualizer": "^1.1.0",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-svg-icons": "^2.0.1",
- "vue-tsc": "^1.8.27"
- },
- "workspaces": {
- "packages": [
- "packages/*"
- ]
+ "vue-tsc": "^2.0.6"
},
"simple-git-hooks": {
"pre-commit": "pnpm lint-staged"
diff --git a/src/components/custom/QRCode.vue b/src/components/custom/QRCode.vue
deleted file mode 100644
index c400a0e..0000000
--- a/src/components/custom/QRCode.vue
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/src/service/api/test.ts b/src/service/api/test.ts
index 91a8ffb..69c64c4 100644
--- a/src/service/api/test.ts
+++ b/src/service/api/test.ts
@@ -1,4 +1,3 @@
-import qs from 'qs'
import { alovaInstance, blankInstance } from '../http'
/* get方法测试 */
@@ -12,11 +11,11 @@ export function fetchPost(data: any) {
}
/* formPost方法测试 */
export function fetchFormPost(data: any) {
- return alovaInstance.Post('/postAPI', qs.stringify(data), {
- headers: {
- 'Content-Type': 'application/x-www-form-urlencoded',
- },
- })
+ const methodInstance = alovaInstance.Post('/postAPI', data)
+ methodInstance.meta = {
+ isFormPost: true,
+ }
+ return methodInstance
}
/* delete方法测试 */
export function fetchDelete() {
diff --git a/src/service/http/alova.ts b/src/service/http/alova.ts
index a6122be..4a42f3e 100644
--- a/src/service/http/alova.ts
+++ b/src/service/http/alova.ts
@@ -2,6 +2,7 @@ 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,
@@ -49,6 +50,10 @@ export function createAlovaInstance(
timeout: _alovaConfig.timeout,
beforeRequest: onAuthRequired((method) => {
+ if (method.meta?.isFormPost) {
+ method.config.headers['Content-Type'] = 'application/x-www-form-urlencoded'
+ method.data = qs.stringify(method.data)
+ }
alovaConfig.beforeRequest?.(method)
}),
responded: onResponseRefreshToken({
diff --git a/src/views/plugin/QRCode/index.vue b/src/views/plugin/QRCode/index.vue
index 8fca790..b76b7d4 100644
--- a/src/views/plugin/QRCode/index.vue
+++ b/src/views/plugin/QRCode/index.vue
@@ -1,21 +1,11 @@
-
-
-
- 生成
-
-
-
+
+