mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-26 17:16:52 +08:00
Fix: Added the ability to download files in the agent message reply function. (#11281)
### What problem does this PR solve? Fix: Added the ability to download files in the agent message reply function. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -13,6 +13,7 @@ const {
|
||||
get_document_file,
|
||||
getFile,
|
||||
moveFile,
|
||||
get_document_file_download,
|
||||
} = api;
|
||||
|
||||
const methods = {
|
||||
@ -65,4 +66,10 @@ const fileManagerService = registerServer<keyof typeof methods>(
|
||||
request,
|
||||
);
|
||||
|
||||
export const downloadFile = (data: { docId: string; ext: string }) => {
|
||||
return request.get(get_document_file_download(data.docId), {
|
||||
params: { ext: data.ext },
|
||||
responseType: 'blob',
|
||||
});
|
||||
};
|
||||
export default fileManagerService;
|
||||
|
||||
Reference in New Issue
Block a user