Skip to content

Commit

Permalink
Auto merge base into main
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Jan 14, 2025
2 parents 0d8e5f2 + 36a7f30 commit f15cf96
Show file tree
Hide file tree
Showing 15 changed files with 672 additions and 300 deletions.
4 changes: 3 additions & 1 deletion openapi-ts-request.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
143 changes: 38 additions & 105 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 3 additions & 8 deletions src/pages/about/components/request.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

<!-- http://localhost:9000/#/pages/index/request -->
<wd-button @click="run" class="my-6">发送请求</wd-button>
<view class="h-12">
<view class="h-16">
<view v-if="loading">loading...</view>
<block v-else>
<view class="text-xl">请求数据如下</view>
Expand All @@ -37,7 +37,7 @@

<script lang="ts" setup>
import { getFooAPI, postFooAPI, IFooItem } from '@/service/index/foo'
import { findPetsByStatus } from '@/service/app'
import { findPetsByStatusQueryOptions } from '@/service/app'
import { useQuery } from '@tanstack/vue-query'
const recommendUrl = ref('http://laf.run/signup?code=ohaOgIX')
Expand All @@ -59,12 +59,7 @@ const {
error: error2,
isLoading: isLoading2,
refetch,
} = useQuery({
queryKey: ['findPetsByStatus'],
queryFn: () => {
return findPetsByStatus({ params: { status: ['available'] } })
},
})
} = useQuery(findPetsByStatusQueryOptions({ params: { status: ['available'] } }))
const reset = () => {
data.value = initialData
Expand Down
Loading

0 comments on commit f15cf96

Please sign in to comment.