refactor: 移除vue-query相关代码及依赖

移除所有与vue-query相关的代码文件、依赖项和配置
清理不再需要的类型定义和导出
更新openapi生成配置禁用reactQuery模式
This commit is contained in:
feige996
2025-09-17 13:57:36 +08:00
parent cecbb38a40
commit 938a9dc43e
16 changed files with 236 additions and 485 deletions

View File

@@ -6,7 +6,7 @@ export default [
serversPath: './src/service',
requestLibPath: `import request from '@/http/vue-query';\n import { CustomRequestOptions } from '@/http/types';`,
requestOptionsType: 'CustomRequestOptions',
isGenReactQuery: true,
isGenReactQuery: false,
reactQueryMode: 'vue',
isGenJavaScript: false,
},

View File

@@ -111,7 +111,6 @@
"@dcloudio/uni-mp-weixin": "3.0.0-4070620250821001",
"@dcloudio/uni-mp-xhs": "3.0.0-4070620250821001",
"@dcloudio/uni-quickapp-webview": "3.0.0-4070620250821001",
"@tanstack/vue-query": "^5.62.16",
"abortcontroller-polyfill": "^1.7.8",
"alova": "^3.3.3",
"dayjs": "1.11.10",

View File

@@ -1,7 +1,6 @@
<script setup lang="ts">
import { onHide, onLaunch, onShow } from '@dcloudio/uni-app'
import { navigateToInterceptor } from '@/router/interceptor'
import 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only'
onLaunch((options) => {
console.log('App Launch', options)

View File

@@ -1,11 +0,0 @@
import { queryOptions } from '@tanstack/vue-query'
import { getFooAPI } from './foo'
export function getFooQueryOptions(name: string) {
return queryOptions({
queryFn: async ({ queryKey }) => {
return getFooAPI(queryKey[1])
},
queryKey: ['getFoo', name],
})
}

View File

@@ -1,4 +1,3 @@
import { VueQueryPlugin } from '@tanstack/vue-query'
import { createSSRApp } from 'vue'
import App from './App.vue'
import { requestInterceptor } from './http/interceptor'
@@ -13,7 +12,6 @@ export function createApp() {
app.use(store)
app.use(routeInterceptor)
app.use(requestInterceptor)
app.use(VueQueryPlugin)
return {
app,

View File

@@ -56,11 +56,6 @@ function gotoAlova() {
url: '/pages/about/alova',
})
}
function gotoVueQuery() {
uni.navigateTo({
url: '/pages/about/vue-query',
})
}
function gotoSubPage() {
uni.navigateTo({
url: '/pages-sub/demo/index',
@@ -129,11 +124,6 @@ onShow(() => {
切换tabbar
</button>
</view>
<view class="text-center">
<button type="primary" size="mini" class="w-160px" @click="gotoVueQuery">
vue-query 示例页面
</button>
</view>
<view class="text-center">
<button type="primary" size="mini" class="w-160px" @click="gotoSubPage">
前往分包页面

View File

@@ -1,50 +0,0 @@
<script lang="ts" setup>
import { useQuery } from '@tanstack/vue-query'
import { foo } from '@/api/foo'
import { getFooQueryOptions } from '@/api/foo-vue-query'
definePage({
style: {
navigationBarTitleText: 'Vue Query 演示',
},
})
// 简单使用
onShow(async () => {
const res = await foo()
console.log('res: ', res)
})
// vue-query 版
const {
data,
error,
isLoading: loading,
refetch: send,
} = useQuery(getFooQueryOptions('菲鸽-vue-query'))
</script>
<template>
<view class="p-6 text-center">
<button type="primary" size="mini" class="my-6 w-160px" @click="send">
发送请求
</button>
<view class="h-16">
<view v-if="loading">
loading...
</view>
<block v-else>
<view class="text-xl">
请求数据如下
</view>
<view class="text-green leading-8">
{{ JSON.stringify(data) }}
</view>
</block>
</view>
</view>
</template>
<style lang="scss" scoped>
//
</style>

View File

@@ -4,8 +4,5 @@ export * from './types';
export * from './displayEnumLabel';
export * from './pet';
export * from './pet.vuequery';
export * from './store';
export * from './store.vuequery';
export * from './user';
export * from './user.vuequery';

View File

@@ -1,7 +1,7 @@
/* eslint-disable */
// @ts-ignore
import request from '@/http/vue-query';
import type { CustomRequestOptions } from '@/http/types';
import { CustomRequestOptions } from '@/http/types';
import * as API from './types';
@@ -47,7 +47,7 @@ export async function petPetIdUsingGet({
options,
}: {
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
params: API.petPetIdUsingGetParams;
params: API.PetPetIdUsingGetParams;
options?: CustomRequestOptions;
}) {
const { petId: param0, ...queryParams } = params;
@@ -66,7 +66,7 @@ export async function petPetIdUsingPost({
options,
}: {
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
params: API.petPetIdUsingPostParams;
params: API.PetPetIdUsingPostParams;
body: API.PetPetIdUsingPostBody;
options?: CustomRequestOptions;
}) {
@@ -89,7 +89,7 @@ export async function petPetIdUsingDelete({
options,
}: {
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
params: API.petPetIdUsingDeleteParams;
params: API.PetPetIdUsingDeleteParams;
options?: CustomRequestOptions;
}) {
const { petId: param0, ...queryParams } = params;
@@ -109,7 +109,7 @@ export async function petPetIdUploadImageUsingPost({
options,
}: {
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
params: API.petPetIdUploadImageUsingPostParams;
params: API.PetPetIdUploadImageUsingPostParams;
body: API.PetPetIdUploadImageUsingPostBody;
file?: File;
options?: CustomRequestOptions;
@@ -154,7 +154,7 @@ export async function petFindByStatusUsingGet({
options,
}: {
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
params: API.petFindByStatusUsingGetParams;
params: API.PetFindByStatusUsingGetParams;
options?: CustomRequestOptions;
}) {
return request<API.Pet[]>('/pet/findByStatus', {
@@ -172,7 +172,7 @@ export async function petFindByTagsUsingGet({
options,
}: {
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
params: API.petFindByTagsUsingGetParams;
params: API.PetFindByTagsUsingGetParams;
options?: CustomRequestOptions;
}) {
return request<API.Pet[]>('/pet/findByTags', {

View File

@@ -1,151 +0,0 @@
/* eslint-disable */
// @ts-ignore
import { queryOptions, useMutation } from '@tanstack/vue-query';
import type { DefaultError } from '@tanstack/vue-query';
import request from '@/http/vue-query';
import type { CustomRequestOptions } from '@/http/types';
import * as apis from './pet';
import * as API from './types';
/** Update an existing pet PUT /pet */
export function usePetUsingPutMutation(options?: {
onSuccess?: (value?: unknown) => void;
onError?: (error?: DefaultError) => void;
}) {
const { onSuccess, onError } = options || {};
const response = useMutation({
mutationFn: apis.petUsingPut,
onSuccess(data: unknown) {
onSuccess?.(data);
},
onError(error) {
onError?.(error);
},
});
return response;
}
/** Add a new pet to the store POST /pet */
export function usePetUsingPostMutation(options?: {
onSuccess?: (value?: unknown) => void;
onError?: (error?: DefaultError) => void;
}) {
const { onSuccess, onError } = options || {};
const response = useMutation({
mutationFn: apis.petUsingPost,
onSuccess(data: unknown) {
onSuccess?.(data);
},
onError(error) {
onError?.(error);
},
});
return response;
}
/** Find pet by ID Returns a single pet GET /pet/${param0} */
export function petPetIdUsingGetQueryOptions(options: {
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
params: API.petPetIdUsingGetParams;
options?: CustomRequestOptions;
}) {
return queryOptions({
queryFn: async ({ queryKey }) => {
return apis.petPetIdUsingGet(queryKey[1] as typeof options);
},
queryKey: ['petPetIdUsingGet', options],
});
}
/** Updates a pet in the store with form data POST /pet/${param0} */
export function usePetPetIdUsingPostMutation(options?: {
onSuccess?: (value?: unknown) => void;
onError?: (error?: DefaultError) => void;
}) {
const { onSuccess, onError } = options || {};
const response = useMutation({
mutationFn: apis.petPetIdUsingPost,
onSuccess(data: unknown) {
onSuccess?.(data);
},
onError(error) {
onError?.(error);
},
});
return response;
}
/** Deletes a pet DELETE /pet/${param0} */
export function usePetPetIdUsingDeleteMutation(options?: {
onSuccess?: (value?: unknown) => void;
onError?: (error?: DefaultError) => void;
}) {
const { onSuccess, onError } = options || {};
const response = useMutation({
mutationFn: apis.petPetIdUsingDelete,
onSuccess(data: unknown) {
onSuccess?.(data);
},
onError(error) {
onError?.(error);
},
});
return response;
}
/** uploads an image POST /pet/${param0}/uploadImage */
export function usePetPetIdUploadImageUsingPostMutation(options?: {
onSuccess?: (value?: API.ApiResponse) => void;
onError?: (error?: DefaultError) => void;
}) {
const { onSuccess, onError } = options || {};
const response = useMutation({
mutationFn: apis.petPetIdUploadImageUsingPost,
onSuccess(data: API.ApiResponse) {
onSuccess?.(data);
},
onError(error) {
onError?.(error);
},
});
return response;
}
/** Finds Pets by status Multiple status values can be provided with comma separated strings GET /pet/findByStatus */
export function petFindByStatusUsingGetQueryOptions(options: {
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
params: API.petFindByStatusUsingGetParams;
options?: CustomRequestOptions;
}) {
return queryOptions({
queryFn: async ({ queryKey }) => {
return apis.petFindByStatusUsingGet(queryKey[1] as typeof options);
},
queryKey: ['petFindByStatusUsingGet', options],
});
}
/** Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. GET /pet/findByTags */
export function petFindByTagsUsingGetQueryOptions(options: {
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
params: API.petFindByTagsUsingGetParams;
options?: CustomRequestOptions;
}) {
return queryOptions({
queryFn: async ({ queryKey }) => {
return apis.petFindByTagsUsingGet(queryKey[1] as typeof options);
},
queryKey: ['petFindByTagsUsingGet', options],
});
}

View File

@@ -1,7 +1,7 @@
/* eslint-disable */
// @ts-ignore
import request from '@/http/vue-query';
import type { CustomRequestOptions } from '@/http/types';
import { CustomRequestOptions } from '@/http/types';
import * as API from './types';
@@ -41,7 +41,7 @@ export async function storeOrderOrderIdUsingGet({
options,
}: {
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
params: API.storeOrderOrderIdUsingGetParams;
params: API.StoreOrderOrderIdUsingGetParams;
options?: CustomRequestOptions;
}) {
const { orderId: param0, ...queryParams } = params;
@@ -59,7 +59,7 @@ export async function storeOrderOrderIdUsingDelete({
options,
}: {
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
params: API.storeOrderOrderIdUsingDeleteParams;
params: API.StoreOrderOrderIdUsingDeleteParams;
options?: CustomRequestOptions;
}) {
const { orderId: param0, ...queryParams } = params;

View File

@@ -1,75 +0,0 @@
/* eslint-disable */
// @ts-ignore
import { queryOptions, useMutation } from '@tanstack/vue-query';
import type { DefaultError } from '@tanstack/vue-query';
import request from '@/http/vue-query';
import type { CustomRequestOptions } from '@/http/types';
import * as apis from './store';
import * as API from './types';
/** Returns pet inventories by status Returns a map of status codes to quantities GET /store/inventory */
export function storeInventoryUsingGetQueryOptions(options: {
options?: CustomRequestOptions;
}) {
return queryOptions({
queryFn: async ({ queryKey }) => {
return apis.storeInventoryUsingGet(queryKey[1] as typeof options);
},
queryKey: ['storeInventoryUsingGet', options],
});
}
/** Place an order for a pet POST /store/order */
export function useStoreOrderUsingPostMutation(options?: {
onSuccess?: (value?: API.Order) => void;
onError?: (error?: DefaultError) => void;
}) {
const { onSuccess, onError } = options || {};
const response = useMutation({
mutationFn: apis.storeOrderUsingPost,
onSuccess(data: API.Order) {
onSuccess?.(data);
},
onError(error) {
onError?.(error);
},
});
return response;
}
/** Find purchase order by ID For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions GET /store/order/${param0} */
export function storeOrderOrderIdUsingGetQueryOptions(options: {
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
params: API.storeOrderOrderIdUsingGetParams;
options?: CustomRequestOptions;
}) {
return queryOptions({
queryFn: async ({ queryKey }) => {
return apis.storeOrderOrderIdUsingGet(queryKey[1] as typeof options);
},
queryKey: ['storeOrderOrderIdUsingGet', options],
});
}
/** Delete purchase order by ID For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors DELETE /store/order/${param0} */
export function useStoreOrderOrderIdUsingDeleteMutation(options?: {
onSuccess?: (value?: unknown) => void;
onError?: (error?: DefaultError) => void;
}) {
const { onSuccess, onError } = options || {};
const response = useMutation({
mutationFn: apis.storeOrderOrderIdUsingDelete,
onSuccess(data: unknown) {
onSuccess?.(data);
},
onError(error) {
onError?.(error);
},
});
return response;
}

View File

@@ -32,16 +32,38 @@ export type Pet = {
status?: 'available' | 'pending' | 'sold';
};
export type petFindByStatusUsingGetParams = {
export type PetFindByStatusUsingGetParams = {
/** Status values that need to be considered for filter */
status: ('available' | 'pending' | 'sold')[];
};
export type petFindByTagsUsingGetParams = {
export type PetFindByStatusUsingGetResponses = {
/**
* successful operation
*/
200: Pet[];
/**
* Invalid status value
*/
400: unknown;
};
export type PetFindByTagsUsingGetParams = {
/** Tags to filter by */
tags: string[];
};
export type PetFindByTagsUsingGetResponses = {
/**
* successful operation
*/
200: Pet[];
/**
* Invalid tag value
*/
400: unknown;
};
export type PetPetIdUploadImageUsingPostBody = {
/** Additional data to pass to server */
additionalMetadata?: string;
@@ -49,21 +71,54 @@ export type PetPetIdUploadImageUsingPostBody = {
file?: string;
};
export type petPetIdUploadImageUsingPostParams = {
export type PetPetIdUploadImageUsingPostParams = {
/** ID of pet to update */
petId: number;
};
export type petPetIdUsingDeleteParams = {
export type PetPetIdUploadImageUsingPostResponses = {
/**
* successful operation
*/
200: ApiResponse;
};
export type PetPetIdUsingDeleteParams = {
/** Pet id to delete */
petId: number;
};
export type petPetIdUsingGetParams = {
export type PetPetIdUsingDeleteResponses = {
/**
* Invalid ID supplied
*/
400: unknown;
/**
* Pet not found
*/
404: unknown;
};
export type PetPetIdUsingGetParams = {
/** ID of pet to return */
petId: number;
};
export type PetPetIdUsingGetResponses = {
/**
* successful operation
*/
200: Pet;
/**
* Invalid ID supplied
*/
400: unknown;
/**
* Pet not found
*/
404: unknown;
};
export type PetPetIdUsingPostBody = {
/** Updated name of the pet */
name?: string;
@@ -71,11 +126,40 @@ export type PetPetIdUsingPostBody = {
status?: string;
};
export type petPetIdUsingPostParams = {
export type PetPetIdUsingPostParams = {
/** ID of pet that needs to be updated */
petId: number;
};
export type PetPetIdUsingPostResponses = {
/**
* Invalid input
*/
405: unknown;
};
export type PetUsingPostResponses = {
/**
* Invalid input
*/
405: unknown;
};
export type PetUsingPutResponses = {
/**
* Invalid ID supplied
*/
400: unknown;
/**
* Pet not found
*/
404: unknown;
/**
* Validation exception
*/
405: unknown;
};
export enum StatusEnum {
'available' = 'available',
'pending' = 'pending',
@@ -92,16 +176,60 @@ export enum StatusEnum2 {
export type IStatusEnum2 = keyof typeof StatusEnum2;
export type storeOrderOrderIdUsingDeleteParams = {
export type StoreInventoryUsingGetResponses = {
/**
* successful operation
*/
200: Record<string, number>;
};
export type StoreOrderOrderIdUsingDeleteParams = {
/** ID of the order that needs to be deleted */
orderId: number;
};
export type storeOrderOrderIdUsingGetParams = {
export type StoreOrderOrderIdUsingDeleteResponses = {
/**
* Invalid ID supplied
*/
400: unknown;
/**
* Order not found
*/
404: unknown;
};
export type StoreOrderOrderIdUsingGetParams = {
/** ID of pet that needs to be fetched */
orderId: number;
};
export type StoreOrderOrderIdUsingGetResponses = {
/**
* successful operation
*/
200: Order;
/**
* Invalid ID supplied
*/
400: unknown;
/**
* Order not found
*/
404: unknown;
};
export type StoreOrderUsingPostResponses = {
/**
* successful operation
*/
200: Order;
/**
* Invalid Order
*/
400: unknown;
};
export type Tag = {
id?: number;
name?: string;
@@ -121,26 +249,102 @@ export type User = {
export type UserCreateWithArrayUsingPostBody = User[];
export type UserCreateWithArrayUsingPostResponses = {
/**
* successful operation
*/
default: unknown;
};
export type UserCreateWithListUsingPostBody = User[];
export type userLoginUsingGetParams = {
export type UserCreateWithListUsingPostResponses = {
/**
* successful operation
*/
default: unknown;
};
export type UserLoginUsingGetParams = {
/** The user name for login */
username: string;
/** The password for login in clear text */
password: string;
};
export type userUsernameUsingDeleteParams = {
export type UserLoginUsingGetResponses = {
/**
* successful operation
*/
200: string;
/**
* Invalid username/password supplied
*/
400: unknown;
};
export type UserLogoutUsingGetResponses = {
/**
* successful operation
*/
default: unknown;
};
export type UserUsernameUsingDeleteParams = {
/** The name that needs to be deleted */
username: string;
};
export type userUsernameUsingGetParams = {
export type UserUsernameUsingDeleteResponses = {
/**
* Invalid username supplied
*/
400: unknown;
/**
* User not found
*/
404: unknown;
};
export type UserUsernameUsingGetParams = {
/** The name that needs to be fetched. Use user1 for testing. */
username: string;
};
export type userUsernameUsingPutParams = {
export type UserUsernameUsingGetResponses = {
/**
* successful operation
*/
200: User;
/**
* Invalid username supplied
*/
400: unknown;
/**
* User not found
*/
404: unknown;
};
export type UserUsernameUsingPutParams = {
/** name that need to be updated */
username: string;
};
export type UserUsernameUsingPutResponses = {
/**
* Invalid user supplied
*/
400: unknown;
/**
* User not found
*/
404: unknown;
};
export type UserUsingPostResponses = {
/**
* successful operation
*/
default: unknown;
};

View File

@@ -1,7 +1,7 @@
/* eslint-disable */
// @ts-ignore
import request from '@/http/vue-query';
import type { CustomRequestOptions } from '@/http/types';
import { CustomRequestOptions } from '@/http/types';
import * as API from './types';
@@ -29,7 +29,7 @@ export async function userUsernameUsingGet({
options,
}: {
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
params: API.userUsernameUsingGetParams;
params: API.UserUsernameUsingGetParams;
options?: CustomRequestOptions;
}) {
const { username: param0, ...queryParams } = params;
@@ -48,7 +48,7 @@ export async function userUsernameUsingPut({
options,
}: {
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
params: API.userUsernameUsingPutParams;
params: API.UserUsernameUsingPutParams;
body: API.User;
options?: CustomRequestOptions;
}) {
@@ -71,7 +71,7 @@ export async function userUsernameUsingDelete({
options,
}: {
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
params: API.userUsernameUsingDeleteParams;
params: API.UserUsernameUsingDeleteParams;
options?: CustomRequestOptions;
}) {
const { username: param0, ...queryParams } = params;
@@ -119,16 +119,16 @@ export async function userCreateWithListUsingPost({
});
}
/** Logs user into the system GET /auth/login */
/** Logs user into the system GET /user/login */
export async function userLoginUsingGet({
params,
options,
}: {
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
params: API.userLoginUsingGetParams;
params: API.UserLoginUsingGetParams;
options?: CustomRequestOptions;
}) {
return request<string>('/auth/login', {
return request<string>('/user/login', {
method: 'GET',
params: {
...params,

View File

@@ -1,149 +0,0 @@
/* eslint-disable */
// @ts-ignore
import { queryOptions, useMutation } from '@tanstack/vue-query';
import type { DefaultError } from '@tanstack/vue-query';
import request from '@/http/vue-query';
import type { CustomRequestOptions } from '@/http/types';
import * as apis from './user';
import * as API from './types';
/** Create user This can only be done by the logged in user. 返回值: successful operation POST /user */
export function useUserUsingPostMutation(options?: {
onSuccess?: (value?: unknown) => void;
onError?: (error?: DefaultError) => void;
}) {
const { onSuccess, onError } = options || {};
const response = useMutation({
mutationFn: apis.userUsingPost,
onSuccess(data: unknown) {
onSuccess?.(data);
},
onError(error) {
onError?.(error);
},
});
return response;
}
/** Get user by user name GET /user/${param0} */
export function userUsernameUsingGetQueryOptions(options: {
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
params: API.userUsernameUsingGetParams;
options?: CustomRequestOptions;
}) {
return queryOptions({
queryFn: async ({ queryKey }) => {
return apis.userUsernameUsingGet(queryKey[1] as typeof options);
},
queryKey: ['userUsernameUsingGet', options],
});
}
/** Updated user This can only be done by the logged in user. PUT /user/${param0} */
export function useUserUsernameUsingPutMutation(options?: {
onSuccess?: (value?: unknown) => void;
onError?: (error?: DefaultError) => void;
}) {
const { onSuccess, onError } = options || {};
const response = useMutation({
mutationFn: apis.userUsernameUsingPut,
onSuccess(data: unknown) {
onSuccess?.(data);
},
onError(error) {
onError?.(error);
},
});
return response;
}
/** Delete user This can only be done by the logged in user. DELETE /user/${param0} */
export function useUserUsernameUsingDeleteMutation(options?: {
onSuccess?: (value?: unknown) => void;
onError?: (error?: DefaultError) => void;
}) {
const { onSuccess, onError } = options || {};
const response = useMutation({
mutationFn: apis.userUsernameUsingDelete,
onSuccess(data: unknown) {
onSuccess?.(data);
},
onError(error) {
onError?.(error);
},
});
return response;
}
/** Creates list of users with given input array 返回值: successful operation POST /user/createWithArray */
export function useUserCreateWithArrayUsingPostMutation(options?: {
onSuccess?: (value?: unknown) => void;
onError?: (error?: DefaultError) => void;
}) {
const { onSuccess, onError } = options || {};
const response = useMutation({
mutationFn: apis.userCreateWithArrayUsingPost,
onSuccess(data: unknown) {
onSuccess?.(data);
},
onError(error) {
onError?.(error);
},
});
return response;
}
/** Creates list of users with given input array 返回值: successful operation POST /user/createWithList */
export function useUserCreateWithListUsingPostMutation(options?: {
onSuccess?: (value?: unknown) => void;
onError?: (error?: DefaultError) => void;
}) {
const { onSuccess, onError } = options || {};
const response = useMutation({
mutationFn: apis.userCreateWithListUsingPost,
onSuccess(data: unknown) {
onSuccess?.(data);
},
onError(error) {
onError?.(error);
},
});
return response;
}
/** Logs user into the system GET /auth/login */
export function userLoginUsingGetQueryOptions(options: {
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
params: API.userLoginUsingGetParams;
options?: CustomRequestOptions;
}) {
return queryOptions({
queryFn: async ({ queryKey }) => {
return apis.userLoginUsingGet(queryKey[1] as typeof options);
},
queryKey: ['userLoginUsingGet', options],
});
}
/** Logs out current logged in user session 返回值: successful operation GET /user/logout */
export function userLogoutUsingGetQueryOptions(options: {
options?: CustomRequestOptions;
}) {
return queryOptions({
queryFn: async ({ queryKey }) => {
return apis.userLogoutUsingGet(queryKey[1] as typeof options);
},
queryKey: ['userLogoutUsingGet', options],
});
}

View File

@@ -186,8 +186,8 @@ export default defineConfig(({ command, mode }) => {
minify: mode === 'development' ? false : 'esbuild',
// 添加外部依赖解决Docker构建中的依赖解析问题
rollupOptions: {
// 前4个由 @tanstack/vue-query 引起的,std-env 由 @uni-helper/uni-env 引起的
external: ['@tanstack/query-core', 'vue-demi', '@vue/devtools-api', '@tanstack/match-sorter-utils', 'std-env'],
// std-env 由 @uni-helper/uni-env 引起的
external: ['std-env'],
},
},
})