From 12093dae5733e9fb180f93678348534c23bf30ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 17 Mar 2020 17:18:22 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesPublic/sendResources.js | 62 +++++++++++-------- 1 file changed, 36 insertions(+), 26 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/sendResources.js b/public/react/src/modules/courses/coursesPublic/sendResources.js index 75726a51f..d86bf5024 100644 --- a/public/react/src/modules/courses/coursesPublic/sendResources.js +++ b/public/react/src/modules/courses/coursesPublic/sendResources.js @@ -213,17 +213,25 @@ class sendResources extends Component{ } + // console.log("description"); + // console.log(description); + if(description===undefined||description===null){ - if(description===undefined){ + }else { + if(description.length>100){ + + this.setState({ + descriptiontype:true + }) + return + } - }else if(description.length>100){ - this.setState({ - descriptiontype:true - }) - return } + + + if(this.props.Exterchainname==="资源设置"){ //设置 let coursesId=this.props.match.params.coursesId; @@ -240,13 +248,17 @@ class sendResources extends Component{ description:description, delay_publish:Radiovalue, }).then((result)=>{ - if(result.data.status===0){ - this.ModalCancelModalCancel(); - this.props.updataleftNavfun(); - this.props.showNotification("设置资源成功"); - this.props.setupdate(1,false) - }else{ - this.props.showNotification(result.data.message); + if(result){ + if(result.data){ + if(result.data.status===0){ + this.ModalCancelModalCancel(); + this.props.updataleftNavfun(); + this.props.showNotification("设置资源成功"); + this.props.setupdate(1,false) + }else{ + this.props.showNotification(result.data.message); + } + } } }) @@ -266,22 +278,20 @@ class sendResources extends Component{ description:description, delay_publish:Radiovalue, }).then((result)=>{ - - - if(result.data.status===0){ - this.ModalCancelModalCancel(); - this.props.updataleftNavfun(); - this.props.showNotification("上传资源成功"); - this.props.setupdate(1,false) - }else{ - this.props.showNotification(result.data.message); + if(result.data){ + if(result.data.status===0){ + if(result.data.status===0){ + this.ModalCancelModalCancel(); + this.props.updataleftNavfun(); + this.props.showNotification("上传资源成功"); + this.props.setupdate(1,false) + }else{ + this.props.showNotification(result.data.message); + } + } } }) - } - - - } settextarea=(e)=>{