diff --git a/apps/oss/serializers/file.py b/apps/oss/serializers/file.py index b9cbe218b..63406a02c 100644 --- a/apps/oss/serializers/file.py +++ b/apps/oss/serializers/file.py @@ -50,6 +50,7 @@ mime_types = { "webm": "video/webm", "flv": "video/x-flv", "m4v": "video/x-m4v", "mng": "video/x-mng", "asx": "video/x-ms-asf", "asf": "video/x-ms-asf", "wmv": "video/x-ms-wmv", "avi": "video/x-msvideo", "wav": "audio/wav", "flac": "audio/flac", "aac": "audio/aac", "opus": "audio/opus", + "csv": "text/csv", "tsv": "text/tab-separated-values", "ics": "text/calendar", } diff --git a/ui/src/api/knowledge/document.ts b/ui/src/api/knowledge/document.ts index 129b33a3e..806ffa0f9 100644 --- a/ui/src/api/knowledge/document.ts +++ b/ui/src/api/knowledge/document.ts @@ -136,11 +136,12 @@ const putCancelTask: ( * 下载原文档 * @param 参数 knowledge_id */ -const getDownloadSourceFile: (knowledge_id: string, document_id: string) => Promise> = ( +const getDownloadSourceFile: (knowledge_id: string, document_id: string, document_name: string) => Promise> = ( knowledge_id, document_id, + document_name, ) => { - return get(`${prefix.value}/${knowledge_id}/document/${document_id}/download_source_file`) + return exportFile(document_name, `${prefix.value}/${knowledge_id}/document/${document_id}/download_source_file`, {}, undefined) } /** diff --git a/ui/src/views/document/index.vue b/ui/src/views/document/index.vue index d70d717d5..c080fce51 100644 --- a/ui/src/views/document/index.vue +++ b/ui/src/views/document/index.vue @@ -944,7 +944,7 @@ function batchRefresh() { function downloadDocument(row: any) { loadSharedApi({ type: 'document', systemType: apiType.value }) - .getDownloadSourceFile(id, row.id) + .getDownloadSourceFile(id, row.id, row.name) .then(() => { getList() })