From f56d0734150d7543d1fe31d684d709e9296d9cad Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Wed, 6 Nov 2019 16:16:50 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A4=E8=AF=81=E4=B8=8A=E4=BC=A0=E9=99=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user/modal/RealNameCertificationModal.js | 24 +++++++------------ 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/public/react/src/modules/user/modal/RealNameCertificationModal.js b/public/react/src/modules/user/modal/RealNameCertificationModal.js index cc5bfc2c6..8309cc5ca 100644 --- a/public/react/src/modules/user/modal/RealNameCertificationModal.js +++ b/public/react/src/modules/user/modal/RealNameCertificationModal.js @@ -44,6 +44,7 @@ class RealNameCertificationModal extends Component{ this.state={ identity:"teacher", departmentsName:undefined, + fileID:undefined, filterSchoolList:undefined, filterDepartments :undefined, school:undefined, @@ -269,7 +270,8 @@ class RealNameCertificationModal extends Component{ axios.post((url),{ name:values.name || basicInfo.name, gender:parseInt(values.sex), - id_number:values.credentials + id_number:values.credentials, + attachment_ids:[this.state.fileID] }).then((result)=>{ if(result){ this.props.showNotification("申请已提交,请等待审核!"); @@ -295,7 +297,8 @@ class RealNameCertificationModal extends Component{ school_id:this.state.school_id, department_id:this.state.department_id, identity:this.state.identity, - extra: values.job == "student" ? values.student_No : values.job == "teacher" ? values.job1 : values.job2 + extra: values.job == "student" ? values.student_No : values.job == "teacher" ? values.job1 : values.job2, + attachment_ids:[this.state.fileID] }).then((result)=>{ if(result){ this.props.showNotification("申请已提交,请等待审核!"); @@ -327,20 +330,7 @@ class RealNameCertificationModal extends Component{ const { course_lists, checkBoxValues } = this.state this.onSendOk() } - - handleChange = (info) => { - if (info.file.status === 'uploading') { - this.setState({ loading: true }); - return; - } - if (info.file.status === 'done') { - // Get this url from response in real world. - getBase64(info.file.originFileObj, imageUrl => this.setState({ - imageUrl, - loading: false, - })); - } - } + handleChange2 = (info) => { if (info.file.status === 'uploading') { this.setState({ loading: true }); @@ -348,9 +338,11 @@ class RealNameCertificationModal extends Component{ } if (info.file.status === 'done') { // Get this url from response in real world. + console.log(info.file.response); getBase64(info.file.originFileObj, imageUrl2 => this.setState({ imageUrl2, loading: false, + fileID:info.file.response && info.file.response.id })); } }