feat(fe): file uploading

This commit is contained in:
Junyan Qin
2025-07-12 17:15:07 +08:00
parent 234b61e2f8
commit d78a329aa9
12 changed files with 937 additions and 59 deletions

View File

@@ -433,7 +433,17 @@ class HttpClient {
// ============ File management API ============
public uploadDocumentFile(file: File): Promise<{ file_id: string }> {
return this.post('/api/v1/files/documents', file);
const formData = new FormData();
formData.append('file', file);
return this.request<{ file_id: string }>({
method: 'post',
url: '/api/v1/files/documents',
data: formData,
headers: {
'Content-Type': 'multipart/form-data',
},
});
}
// ============ Knowledge Base API ============