diff --git a/openapi-ts-request.config.ts b/openapi-ts-request.config.ts
index d29b41a..b9924e4 100644
--- a/openapi-ts-request.config.ts
+++ b/openapi-ts-request.config.ts
@@ -4,8 +4,10 @@ export default [
{
schemaPath: 'http://petstore.swagger.io/v2/swagger.json',
serversPath: './src/service/app',
- requestLibPath: `import { request } from '@/utils/http';\n import { CustomRequestOptions } from '@/interceptors/request';`,
+ requestLibPath: `import request from '@/utils/request';\n import { CustomRequestOptions } from '@/interceptors/request';`,
requestOptionsType: 'CustomRequestOptions',
+ isGenReactQuery: true,
+ reactQueryMode: 'vue',
isGenJavaScript: false,
},
] as GenerateServiceProps[]
diff --git a/package.json b/package.json
index a8be0a5..b7b0f05 100644
--- a/package.json
+++ b/package.json
@@ -153,7 +153,7 @@
"eslint-plugin-vue": "^9.32.0",
"husky": "^8.0.3",
"lint-staged": "^15.2.10",
- "openapi-ts-request": "^1.0.1",
+ "openapi-ts-request": "^1.1.2",
"postcss": "^8.4.49",
"postcss-html": "^1.7.0",
"postcss-scss": "^4.0.9",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 0b09201..8360c99 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -193,8 +193,8 @@ importers:
specifier: ^15.2.10
version: 15.2.10
openapi-ts-request:
- specifier: ^1.0.1
- version: 1.0.1(@types/node@20.17.9)(@vue/compiler-sfc@3.5.13)(chokidar@3.6.0)(typescript@5.7.2)
+ specifier: ^1.1.2
+ version: 1.1.2(@types/node@20.17.9)(@vue/compiler-sfc@3.5.13)(chokidar@3.6.0)(typescript@5.7.2)
postcss:
specifier: ^8.4.49
version: 8.4.49
@@ -358,10 +358,6 @@ packages:
resolution: {integrity: sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg==}
engines: {node: '>=6.9.0'}
- '@babel/generator@7.17.7':
- resolution: {integrity: sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w==}
- engines: {node: '>=6.9.0'}
-
'@babel/generator@7.26.2':
resolution: {integrity: sha512-zevQbhbau95nkoxSq3f/DC/SC+EEOUZd3DYqfSkMhY2/wfSeaHV1Ew4vk8e+x8lja31IbyuUa2uQ3JONqKbysw==}
engines: {node: '>=6.9.0'}
@@ -395,18 +391,6 @@ packages:
peerDependencies:
'@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0
- '@babel/helper-environment-visitor@7.24.7':
- resolution: {integrity: sha512-DoiN84+4Gnd0ncbBOM9AZENV4a5ZiL39HYMyZJGZ/AZEykHYdJw0wW3kdcsh9/Kn+BRXHLkkklZ51ecPKmI1CQ==}
- engines: {node: '>=6.9.0'}
-
- '@babel/helper-function-name@7.24.7':
- resolution: {integrity: sha512-FyoJTsj/PEUWu1/TYRiXTIHc8lbw+TDYkZuoE43opPS5TrI7MyONBE1oNvfguEXAD9yhQRrVBnXdXzSLQl9XnA==}
- engines: {node: '>=6.9.0'}
-
- '@babel/helper-hoist-variables@7.24.7':
- resolution: {integrity: sha512-MJJwhkoGy5c4ehfoRyrJ/owKeMl19U54h27YYftT0o2teQ3FJ3nQUf/I3LlJsX4l3qlw7WRXUmiyajvHXoTubQ==}
- engines: {node: '>=6.9.0'}
-
'@babel/helper-member-expression-to-functions@7.25.9':
resolution: {integrity: sha512-wbfdZ9w5vk0C0oyHqAJbc62+vet5prjj01jjJ8sKn3j9h3MQQlflEdXYvuqRWjHnM12coDEqiC1IRCi0U/EKwQ==}
engines: {node: '>=6.9.0'}
@@ -449,10 +433,6 @@ packages:
resolution: {integrity: sha512-K4Du3BFa3gvyhzgPcntrkDgZzQaq6uozzcpGbOO1OEJaI+EJdqWIMTLgFgQf6lrfiDFo5FU+BxKepI9RmZqahA==}
engines: {node: '>=6.9.0'}
- '@babel/helper-split-export-declaration@7.24.7':
- resolution: {integrity: sha512-oy5V7pD+UvfkEATUKvIjvIAH/xCzfsFVw7ygW2SI6NClZzquT+mwdTfgfdbUiceh6iQO0CHtCPsyze/MZ2YbAA==}
- engines: {node: '>=6.9.0'}
-
'@babel/helper-string-parser@7.25.9':
resolution: {integrity: sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==}
engines: {node: '>=6.9.0'}
@@ -948,18 +928,10 @@ packages:
resolution: {integrity: sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg==}
engines: {node: '>=6.9.0'}
- '@babel/traverse@7.23.2':
- resolution: {integrity: sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==}
- engines: {node: '>=6.9.0'}
-
'@babel/traverse@7.25.9':
resolution: {integrity: sha512-ZCuvfwOwlz/bawvAuvcj8rrithP2/N55Tzz342AkTvq4qaWbGfmCk/tKhNaV2cthijKrPAA8SRJV5WWe7IBMJw==}
engines: {node: '>=6.9.0'}
- '@babel/types@7.17.0':
- resolution: {integrity: sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==}
- engines: {node: '>=6.9.0'}
-
'@babel/types@7.26.0':
resolution: {integrity: sha512-Z/yiTPj+lDVnF7lWeKCIJzaIkI0vYO87dMpZ4bg4TDrFe4XXLFWL1TbXU27gBP3QccxV9mZICCrnjnYlJjXHOA==}
engines: {node: '>=6.9.0'}
@@ -2015,14 +1987,21 @@ packages:
resolution: {integrity: sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==}
engines: {node: '>= 6'}
- '@trivago/prettier-plugin-sort-imports@4.3.0':
- resolution: {integrity: sha512-r3n0onD3BTOVUNPhR4lhVK4/pABGpbA7bW3eumZnYdKaHkf1qEC+Mag6DPbGNuuh0eG8AaYj+YqmVHSiGslaTQ==}
+ '@trivago/prettier-plugin-sort-imports@5.2.1':
+ resolution: {integrity: sha512-NDZndt0fmVThIx/8cExuJHLZagUVzfGCoVrwH9x6aZvwfBdkrDFTYujecek6X2WpG4uUFsVaPg5+aNQPSyjcmw==}
+ engines: {node: '>18.12'}
peerDependencies:
'@vue/compiler-sfc': 3.x
prettier: 2.x - 3.x
+ prettier-plugin-svelte: 3.x
+ svelte: 4.x || 5.x
peerDependenciesMeta:
'@vue/compiler-sfc':
optional: true
+ prettier-plugin-svelte:
+ optional: true
+ svelte:
+ optional: true
'@types/babel__core@7.20.5':
resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==}
@@ -3161,6 +3140,14 @@ packages:
cosmiconfig: '>=8.2'
typescript: '>=4'
+ cosmiconfig-typescript-loader@6.1.0:
+ resolution: {integrity: sha512-tJ1w35ZRUiM5FeTzT7DtYWAFFv37ZLqSRkGi2oeCK1gPhvaWjkAtfXvLmvE1pRfxxp9aQo6ba/Pvg1dKj05D4g==}
+ engines: {node: '>=v18'}
+ peerDependencies:
+ '@types/node': '*'
+ cosmiconfig: '>=9'
+ typescript: '>=5'
+
cosmiconfig@8.3.6:
resolution: {integrity: sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA==}
engines: {node: '>=14'}
@@ -4603,6 +4590,10 @@ packages:
resolution: {integrity: sha512-2yTgeWTWzMWkHu6Jp9NKgePDaYHbntiwvYuuJLbbN9vl7DC9DvXKOB2BC3ZZ92D3cvV/aflH0osDfwpHepQ53w==}
hasBin: true
+ jiti@2.4.2:
+ resolution: {integrity: sha512-rg9zJN+G4n2nfJl5MW3BMygZX56zKPNVEYYqq7adpmMh4Jn2QNEwhvQlFy6jPVdcod7txZtKHWnyZiA3a0zP7A==}
+ hasBin: true
+
jpeg-js@0.3.7:
resolution: {integrity: sha512-9IXdWudL61npZjvLuVe/ktHiA41iE8qFyLB+4VDTblEsWBzeg8WQTlktdUK4CdncUqtUgUg0bbOmTE2bKBKaBQ==}
@@ -4629,11 +4620,6 @@ packages:
canvas:
optional: true
- jsesc@2.5.2:
- resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==}
- engines: {node: '>=4'}
- hasBin: true
-
jsesc@3.0.2:
resolution: {integrity: sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==}
engines: {node: '>=6'}
@@ -5230,8 +5216,8 @@ packages:
resolution: {integrity: sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==}
engines: {node: '>=12'}
- openapi-ts-request@1.0.1:
- resolution: {integrity: sha512-FcFJssF/820EPkA3g3AklKoT59h1If9CfnzkgV4ct4SJzn7up9V1fGaMoA9im/BTaH6wC8UpMXzE+pwsjaXYfQ==}
+ openapi-ts-request@1.1.2:
+ resolution: {integrity: sha512-Hzqm3JzxgzyGGrTv1THo21HqDea215IQq4I3Ic/WMh/Y+SbmeLb7VQmdeIORPP3Wx836qlTm3X0H10ignkPqfQ==}
engines: {node: '>=18.0.0', pnpm: '>=9'}
hasBin: true
@@ -5960,10 +5946,6 @@ packages:
source-map-support@0.5.21:
resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==}
- source-map@0.5.7:
- resolution: {integrity: sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==}
- engines: {node: '>=0.10.0'}
-
source-map@0.6.1:
resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==}
engines: {node: '>=0.10.0'}
@@ -6282,10 +6264,6 @@ packages:
tmpl@1.0.5:
resolution: {integrity: sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==}
- to-fast-properties@2.0.0:
- resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==}
- engines: {node: '>=4'}
-
to-regex-range@5.0.1:
resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==}
engines: {node: '>=8.0'}
@@ -7022,12 +7000,6 @@ snapshots:
transitivePeerDependencies:
- supports-color
- '@babel/generator@7.17.7':
- dependencies:
- '@babel/types': 7.26.0
- jsesc: 2.5.2
- source-map: 0.5.7
-
'@babel/generator@7.26.2':
dependencies:
'@babel/parser': 7.26.2
@@ -7086,19 +7058,6 @@ snapshots:
transitivePeerDependencies:
- supports-color
- '@babel/helper-environment-visitor@7.24.7':
- dependencies:
- '@babel/types': 7.26.0
-
- '@babel/helper-function-name@7.24.7':
- dependencies:
- '@babel/template': 7.25.9
- '@babel/types': 7.26.0
-
- '@babel/helper-hoist-variables@7.24.7':
- dependencies:
- '@babel/types': 7.26.0
-
'@babel/helper-member-expression-to-functions@7.25.9':
dependencies:
'@babel/traverse': 7.25.9
@@ -7160,10 +7119,6 @@ snapshots:
transitivePeerDependencies:
- supports-color
- '@babel/helper-split-export-declaration@7.24.7':
- dependencies:
- '@babel/types': 7.26.0
-
'@babel/helper-string-parser@7.25.9': {}
'@babel/helper-validator-identifier@7.25.9': {}
@@ -7759,21 +7714,6 @@ snapshots:
'@babel/parser': 7.26.2
'@babel/types': 7.26.0
- '@babel/traverse@7.23.2':
- dependencies:
- '@babel/code-frame': 7.26.2
- '@babel/generator': 7.26.2
- '@babel/helper-environment-visitor': 7.24.7
- '@babel/helper-function-name': 7.24.7
- '@babel/helper-hoist-variables': 7.24.7
- '@babel/helper-split-export-declaration': 7.24.7
- '@babel/parser': 7.26.2
- '@babel/types': 7.26.0
- debug: 4.3.7
- globals: 11.12.0
- transitivePeerDependencies:
- - supports-color
-
'@babel/traverse@7.25.9':
dependencies:
'@babel/code-frame': 7.26.2
@@ -7786,11 +7726,6 @@ snapshots:
transitivePeerDependencies:
- supports-color
- '@babel/types@7.17.0':
- dependencies:
- '@babel/helper-validator-identifier': 7.25.9
- to-fast-properties: 2.0.0
-
'@babel/types@7.26.0':
dependencies:
'@babel/helper-string-parser': 7.25.9
@@ -9436,12 +9371,12 @@ snapshots:
'@tootallnate/once@1.1.2': {}
- '@trivago/prettier-plugin-sort-imports@4.3.0(@vue/compiler-sfc@3.5.13)(prettier@3.3.2)':
+ '@trivago/prettier-plugin-sort-imports@5.2.1(@vue/compiler-sfc@3.5.13)(prettier@3.3.2)':
dependencies:
- '@babel/generator': 7.17.7
+ '@babel/generator': 7.26.2
'@babel/parser': 7.26.2
- '@babel/traverse': 7.23.2
- '@babel/types': 7.17.0
+ '@babel/traverse': 7.25.9
+ '@babel/types': 7.26.0
javascript-natural-sort: 0.7.1
lodash: 4.17.21
prettier: 3.3.2
@@ -10914,11 +10849,11 @@ snapshots:
jiti: 1.21.6
typescript: 5.7.2
- cosmiconfig-typescript-loader@5.1.0(@types/node@20.17.9)(cosmiconfig@9.0.0(typescript@5.7.2))(typescript@5.7.2):
+ cosmiconfig-typescript-loader@6.1.0(@types/node@20.17.9)(cosmiconfig@9.0.0(typescript@5.7.2))(typescript@5.7.2):
dependencies:
'@types/node': 20.17.9
cosmiconfig: 9.0.0(typescript@5.7.2)
- jiti: 1.21.6
+ jiti: 2.4.2
typescript: 5.7.2
cosmiconfig@8.3.6(typescript@5.7.2):
@@ -12724,6 +12659,8 @@ snapshots:
jiti@1.21.6: {}
+ jiti@2.4.2: {}
+
jpeg-js@0.3.7: {}
js-tokens@4.0.0: {}
@@ -12773,8 +12710,6 @@ snapshots:
- supports-color
- utf-8-validate
- jsesc@2.5.2: {}
-
jsesc@3.0.2: {}
json-buffer@3.0.1: {}
@@ -13352,16 +13287,16 @@ snapshots:
is-docker: 2.2.1
is-wsl: 2.2.0
- openapi-ts-request@1.0.1(@types/node@20.17.9)(@vue/compiler-sfc@3.5.13)(chokidar@3.6.0)(typescript@5.7.2):
+ openapi-ts-request@1.1.2(@types/node@20.17.9)(@vue/compiler-sfc@3.5.13)(chokidar@3.6.0)(typescript@5.7.2):
dependencies:
'@prettier/sync': 0.5.2(prettier@3.3.2)
- '@trivago/prettier-plugin-sort-imports': 4.3.0(@vue/compiler-sfc@3.5.13)(prettier@3.3.2)
+ '@trivago/prettier-plugin-sort-imports': 5.2.1(@vue/compiler-sfc@3.5.13)(prettier@3.3.2)
axios: 1.7.9
bing-translate-api: 4.0.2
chalk: 4.1.2
commander: 12.1.0
cosmiconfig: 9.0.0(typescript@5.7.2)
- cosmiconfig-typescript-loader: 5.1.0(@types/node@20.17.9)(cosmiconfig@9.0.0(typescript@5.7.2))(typescript@5.7.2)
+ cosmiconfig-typescript-loader: 6.1.0(@types/node@20.17.9)(cosmiconfig@9.0.0(typescript@5.7.2))(typescript@5.7.2)
glob: 11.0.0
js-yaml: 4.1.0
lodash: 4.17.21
@@ -13381,7 +13316,9 @@ snapshots:
- chokidar
- debug
- encoding
+ - prettier-plugin-svelte
- supports-color
+ - svelte
- typescript
optionator@0.9.4:
@@ -14129,8 +14066,6 @@ snapshots:
buffer-from: 1.1.2
source-map: 0.6.1
- source-map@0.5.7: {}
-
source-map@0.6.1: {}
source-map@0.7.4: {}
@@ -14511,8 +14446,6 @@ snapshots:
tmpl@1.0.5: {}
- to-fast-properties@2.0.0: {}
-
to-regex-range@5.0.1:
dependencies:
is-number: 7.0.0
diff --git a/src/pages/about/components/request.vue b/src/pages/about/components/request.vue
index d5acb7c..d8a1e96 100644
--- a/src/pages/about/components/request.vue
+++ b/src/pages/about/components/request.vue
@@ -24,7 +24,7 @@
发送请求
-
+
loading...
请求数据如下
@@ -37,7 +37,7 @@