mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-12 22:38:58 +08:00
fix: Fixed the issue where the error message was not displayed when uploading a file that was too large #1782 (#2654)
### What problem does this PR solve? _Briefly describe what this PR aims to solve. Include background context that will help reviewers understand the purpose of the PR._ ### 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:
parent
01db00b587
commit
d3b37b0b70
@ -208,13 +208,13 @@ export const useUploadFile = () => {
|
|||||||
formData.append('path', pathList[index]);
|
formData.append('path', pathList[index]);
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
const { data } = await fileManagerService.uploadFile(formData);
|
const ret = await fileManagerService.uploadFile(formData);
|
||||||
if (data.retcode === 0) {
|
if (ret?.data.retcode === 0) {
|
||||||
message.success(t('message.uploaded'));
|
message.success(t('message.uploaded'));
|
||||||
setPaginationParams(1);
|
setPaginationParams(1);
|
||||||
queryClient.invalidateQueries({ queryKey: ['fetchFileList'] });
|
queryClient.invalidateQueries({ queryKey: ['fetchFileList'] });
|
||||||
}
|
}
|
||||||
return data.retcode;
|
return ret?.data?.retcode;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('🚀 ~ useUploadFile ~ error:', error);
|
console.log('🚀 ~ useUploadFile ~ error:', error);
|
||||||
}
|
}
|
||||||
|
@ -217,20 +217,20 @@ const model: DvaModel<KFModelState> = {
|
|||||||
formData.append('file', file);
|
formData.append('file', file);
|
||||||
});
|
});
|
||||||
|
|
||||||
const { data } = yield call(kbService.document_upload, formData);
|
const ret = yield call(kbService.document_upload, formData);
|
||||||
|
|
||||||
const succeed = data.retcode === 0;
|
const succeed = ret?.data?.retcode === 0;
|
||||||
|
|
||||||
if (succeed) {
|
if (succeed) {
|
||||||
message.success(i18n.t('message.uploaded'));
|
message.success(i18n.t('message.uploaded'));
|
||||||
}
|
}
|
||||||
if (succeed || data.retcode === 500) {
|
if (succeed || ret?.data?.retcode === 500) {
|
||||||
yield put({
|
yield put({
|
||||||
type: 'getKfList',
|
type: 'getKfList',
|
||||||
payload: { kb_id: payload.kb_id },
|
payload: { kb_id: payload.kb_id },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return data;
|
return ret?.data;
|
||||||
},
|
},
|
||||||
*web_crawl({ payload = {} }, { call, put }) {
|
*web_crawl({ payload = {} }, { call, put }) {
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user