feat: update getDownloadSourceFile to include document_name parameter for file export

--bug=1058717 --user=刘瑞斌 【共享资源】知识库-下载原文档-报错 https://www.tapd.cn/62980211/s/1730722
This commit is contained in:
CaptainB 2025-07-14 17:59:15 +08:00
parent 9fc20ca53f
commit 939da5b94b
2 changed files with 6 additions and 4 deletions

View File

@ -126,11 +126,12 @@ const putCancelTask: (
*
* @param knowledge_id
*/
const getDownloadSourceFile: (knowledge_id: string, document_id: string) => Promise<Result<any>> = (
const getDownloadSourceFile: (knowledge_id: string, document_id: string, document_name: string) => Promise<Result<any>> = (
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)
}
/**

View File

@ -126,11 +126,12 @@ const putCancelTask: (
*
* @param knowledge_id
*/
const getDownloadSourceFile: (knowledge_id: string, document_id: string) => Promise<Result<any>> = (
const getDownloadSourceFile: (knowledge_id: string, document_id: string, document_name: string) => Promise<Result<any>> = (
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)
}
/**