feat: select the corresponding parsing method according to the file type and after the document is successfully uploaded, use the ChunkMethodModal to select the parsing method. and remove ChunkMethodModal from knowledge-file (#158)
* feat: select the corresponding parsing method according to the file type * feat: after the document is successfully uploaded, use the ChunkMethodModal to select the parsing method. * feat: add pdf types to ParserListMap * feat: remove ChunkMethodModal from knowledge-file
This commit is contained in:
@@ -209,6 +209,19 @@ const model: DvaModel<KFModelState> = {
|
||||
console.warn(error);
|
||||
}
|
||||
},
|
||||
*upload_document({ payload = {} }, { call, put }) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', payload.file);
|
||||
formData.append('kb_id', payload.kb_id);
|
||||
const { data } = yield call(kbService.document_upload, formData);
|
||||
if (data.retcode === 0) {
|
||||
yield put({
|
||||
type: 'getKfList',
|
||||
payload: { kb_id: payload.kb_id },
|
||||
});
|
||||
}
|
||||
return data;
|
||||
},
|
||||
},
|
||||
};
|
||||
export default model;
|
||||
|
||||
Reference in New Issue
Block a user