feat: refine sftp pane upload workflow

This commit is contained in:
liumangmang
2026-04-22 17:59:07 +08:00
parent 423cca97a6
commit 165cc0e35b
10 changed files with 1188 additions and 74 deletions
+2 -2
View File
@@ -27,11 +27,11 @@ export async function downloadFile(connectionId: number, path: string, downloadN
URL.revokeObjectURL(url)
}
export function uploadFile(connectionId: number, path: string, file: File) {
export function uploadFile(connectionId: number, path: string, file: File, options?: { overwrite?: boolean }) {
const form = new FormData()
form.append('file', file, file.name)
return http.post<{ taskId: string; message: string }>('/sftp/upload', form, {
params: { connectionId, path },
params: { connectionId, path, overwrite: options?.overwrite ?? false },
})
}