diff --git a/openapi-ts-request.config.ts b/openapi-ts-request.config.ts index ce344d0..84c6ddf 100644 --- a/openapi-ts-request.config.ts +++ b/openapi-ts-request.config.ts @@ -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, }, diff --git a/package.json b/package.json index 9680441..7befd93 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/App.vue b/src/App.vue index 21a4f8f..9c47bc2 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,7 +1,6 @@ - - - - diff --git a/src/service/index.ts b/src/service/index.ts index 45b6e53..2e13a3c 100644 --- a/src/service/index.ts +++ b/src/service/index.ts @@ -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'; diff --git a/src/service/pet.ts b/src/service/pet.ts index 1fc0a92..b625597 100644 --- a/src/service/pet.ts +++ b/src/service/pet.ts @@ -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('/pet/findByStatus', { @@ -172,7 +172,7 @@ export async function petFindByTagsUsingGet({ options, }: { // 叠加生成的Param类型 (非body参数openapi默认没有生成对象) - params: API.petFindByTagsUsingGetParams; + params: API.PetFindByTagsUsingGetParams; options?: CustomRequestOptions; }) { return request('/pet/findByTags', { diff --git a/src/service/pet.vuequery.ts b/src/service/pet.vuequery.ts deleted file mode 100644 index a2369ea..0000000 --- a/src/service/pet.vuequery.ts +++ /dev/null @@ -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], - }); -} diff --git a/src/service/store.ts b/src/service/store.ts index cc272f3..8f6c6be 100644 --- a/src/service/store.ts +++ b/src/service/store.ts @@ -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; diff --git a/src/service/store.vuequery.ts b/src/service/store.vuequery.ts deleted file mode 100644 index 2f95787..0000000 --- a/src/service/store.vuequery.ts +++ /dev/null @@ -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; -} diff --git a/src/service/types.ts b/src/service/types.ts index 800530e..8715b7e 100644 --- a/src/service/types.ts +++ b/src/service/types.ts @@ -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; +}; + +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; +}; diff --git a/src/service/user.ts b/src/service/user.ts index f3b2b78..f95e8e6 100644 --- a/src/service/user.ts +++ b/src/service/user.ts @@ -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('/auth/login', { + return request('/user/login', { method: 'GET', params: { ...params, diff --git a/src/service/user.vuequery.ts b/src/service/user.vuequery.ts deleted file mode 100644 index 6e5851f..0000000 --- a/src/service/user.vuequery.ts +++ /dev/null @@ -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], - }); -} diff --git a/vite.config.ts b/vite.config.ts index 4275b14..5c8a119 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -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'], }, }, })