Skip to content

Commit 939da5b

Browse files
committed
feat: update getDownloadSourceFile to include document_name parameter for file export
--bug=1058717 --user=刘瑞斌 【共享资源】知识库-下载原文档-报错 https://www.tapd.cn/62980211/s/1730722
1 parent 9fc20ca commit 939da5b

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

ui/src/api/system-resource-management/document.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,12 @@ const putCancelTask: (
126126
* 下载原文档
127127
* @param 参数 knowledge_id
128128
*/
129-
const getDownloadSourceFile: (knowledge_id: string, document_id: string) => Promise<Result<any>> = (
129+
const getDownloadSourceFile: (knowledge_id: string, document_id: string, document_name: string) => Promise<Result<any>> = (
130130
knowledge_id,
131131
document_id,
132+
document_name
132133
) => {
133-
return get(`${prefix}/${knowledge_id}/document/${document_id}/download_source_file`)
134+
return exportFile(document_name, `${prefix}/${knowledge_id}/document/${document_id}/download_source_file`, {}, undefined)
134135
}
135136

136137
/**

ui/src/api/system-shared/document.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,12 @@ const putCancelTask: (
126126
* 下载原文档
127127
* @param 参数 knowledge_id
128128
*/
129-
const getDownloadSourceFile: (knowledge_id: string, document_id: string) => Promise<Result<any>> = (
129+
const getDownloadSourceFile: (knowledge_id: string, document_id: string, document_name: string) => Promise<Result<any>> = (
130130
knowledge_id,
131131
document_id,
132+
document_name
132133
) => {
133-
return get(`${prefix}/${knowledge_id}/document/${document_id}/download_source_file`)
134+
return exportFile(document_name, `${prefix}/${knowledge_id}/document/${document_id}/download_source_file`, {}, undefined)
134135
}
135136

136137
/**

0 commit comments

Comments
 (0)