beforeUploadFile(file) {
const formData = new FormData();
formData.append("files", file);
let params = {
data: formData
}
uploadFile(params).then(res => {
if (res.resultCode == 0 || res.resultCode == 112) {
this.setState({
fileId2Data: [{ uid: res.data[0], name: file.name }],
}, () => {
this.state.formRef.current.setFieldsValue({
fileId2: res.data[0]
})
})
} else {
message.error(res.message)
}
})
}