From 939da5b94b4d209644e928ebfd413b76e30fd616 Mon Sep 17 00:00:00 2001 From: CaptainB Date: Mon, 14 Jul 2025 17:59:15 +0800 Subject: [PATCH] feat: update getDownloadSourceFile to include document_name parameter for file export MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1058717 --user=刘瑞斌 【共享资源】知识库-下载原文档-报错 https://www.tapd.cn/62980211/s/1730722 --- ui/src/api/system-resource-management/document.ts | 5 +++-- ui/src/api/system-shared/document.ts | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ui/src/api/system-resource-management/document.ts b/ui/src/api/system-resource-management/document.ts index c0184e9fd..4af9061e6 100644 --- a/ui/src/api/system-resource-management/document.ts +++ b/ui/src/api/system-resource-management/document.ts @@ -126,11 +126,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}/${knowledge_id}/document/${document_id}/download_source_file`) + return exportFile(document_name, `${prefix}/${knowledge_id}/document/${document_id}/download_source_file`, {}, undefined) } /** diff --git a/ui/src/api/system-shared/document.ts b/ui/src/api/system-shared/document.ts index d2505e45c..58d9a9364 100644 --- a/ui/src/api/system-shared/document.ts +++ b/ui/src/api/system-shared/document.ts @@ -126,11 +126,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}/${knowledge_id}/document/${document_id}/download_source_file`) + return exportFile(document_name, `${prefix}/${knowledge_id}/document/${document_id}/download_source_file`, {}, undefined) } /**