mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? fix: Fixed the issue of error reporting when uploading files in the chat box #2897 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) - [ ] New Feature (non-breaking change which adds functionality) - [ ] Documentation Update - [ ] Refactoring - [ ] Performance Improvement - [ ] Other (please describe):
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
import api from '@/utils/api';
|
||||
import registerServer from '@/utils/register-server';
|
||||
import request from '@/utils/request';
|
||||
import pureRequest from 'umi-request';
|
||||
|
||||
const {
|
||||
create_kb,
|
||||
@ -25,7 +24,6 @@ const {
|
||||
retrieval_test,
|
||||
document_rename,
|
||||
document_run,
|
||||
get_document_file,
|
||||
document_upload,
|
||||
web_crawl,
|
||||
knowledge_graph,
|
||||
@ -145,39 +143,4 @@ const methods = {
|
||||
|
||||
const kbService = registerServer<keyof typeof methods>(methods, request);
|
||||
|
||||
export const getDocumentFile = (documentId: string) => {
|
||||
return pureRequest(get_document_file + '/' + documentId, {
|
||||
responseType: 'blob',
|
||||
method: 'get',
|
||||
parseResponse: false,
|
||||
// getResponse: true,
|
||||
})
|
||||
.then((res) => {
|
||||
const x = res.headers.get('content-disposition');
|
||||
console.info(res);
|
||||
console.info(x);
|
||||
return res.blob();
|
||||
})
|
||||
.then((res) => {
|
||||
// const objectURL = URL.createObjectURL(res);
|
||||
|
||||
// let btn = document.createElement('a');
|
||||
|
||||
// btn.download = '文件名.pdf';
|
||||
|
||||
// btn.href = objectURL;
|
||||
|
||||
// btn.click();
|
||||
|
||||
// URL.revokeObjectURL(objectURL);
|
||||
|
||||
// btn = null;
|
||||
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
console.info(err);
|
||||
});
|
||||
};
|
||||
|
||||
export default kbService;
|
||||
|
||||
Reference in New Issue
Block a user