From 0d61be1413f24aa2d0befa3e736260bcb3df97c5 Mon Sep 17 00:00:00 2001 From: attacker Date: Fri, 19 Jun 2026 01:32:43 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20API=E7=B1=BB=E5=9E=8B=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=20default=5Fport=20+=20importInstances=20opts=20=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/services/api.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/services/api.ts b/frontend/src/services/api.ts index a4bf506..8b92790 100644 --- a/frontend/src/services/api.ts +++ b/frontend/src/services/api.ts @@ -136,7 +136,7 @@ export const serverApi = { batchDelete: async (ids: number[]) => { return http.post('/servers/batch-delete', { ids }); }, - batchCreate: async (data: { servers: any[]; region_id?: string; auth_type?: string; credential_id?: number }) => { + batchCreate: async (data: { servers: any[]; region_id?: string; auth_type?: string; credential_id?: number; default_port?: number }) => { return http.post('/servers/batch', data); }, getMetrics: async (id: number | string) => { @@ -414,8 +414,8 @@ export const cloudApi = { return http.post<{ list: any[]; total: number; errors: string[] }>(`/cloud-accounts/${id}/discover-instances`, { regions }); }, // 导入选中的云主机实例为本地服务器 - importInstances: async (id: number | string, instances: any[]) => { - return http.post<{ imported: number; skipped: number }>(`/cloud-accounts/${id}/import-instances`, { instances }); + importInstances: async (id: number | string, instances: any[], opts?: { default_port?: number; credential_id?: number }) => { + return http.post<{ imported: number; skipped: number }>(`/cloud-accounts/${id}/import-instances`, { instances, ...opts }); }, getDomains: async (params?: { page?: number; page_size?: number; keyword?: string }) => { return http.get('/domains', params);