From bb2e1eb2bfe8a16f771757ed2301baa704ecb37d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 2 Jan 2020 17:27:05 +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 --- .../src/modules/courses/coursesPublic/SelectSetting.js | 7 +++++-- .../src/modules/courses/coursesPublic/sendResource.js | 8 ++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/SelectSetting.js b/public/react/src/modules/courses/coursesPublic/SelectSetting.js index 337b4d2e8..1e177be3d 100644 --- a/public/react/src/modules/courses/coursesPublic/SelectSetting.js +++ b/public/react/src/modules/courses/coursesPublic/SelectSetting.js @@ -108,10 +108,13 @@ class Selectsetting extends Component{ let {fileList,is_public,description,datatime,Radiovalue}=this.state; let newfileList=[]; - for(var list of fileList){ - newfileList.push(list.response.id) + if(fileList!=undefined&&fileList.length>0){ + for(var list of fileList){ + newfileList.push(list.response.id) + } } + if(this.state.Radiovalue===1){ if(datatime===undefined||datatime===null||datatime=== ""){ this.setState({ diff --git a/public/react/src/modules/courses/coursesPublic/sendResource.js b/public/react/src/modules/courses/coursesPublic/sendResource.js index 0f4e3cfbe..e423340e7 100644 --- a/public/react/src/modules/courses/coursesPublic/sendResource.js +++ b/public/react/src/modules/courses/coursesPublic/sendResource.js @@ -130,10 +130,14 @@ class Sendresource extends Component{ let {fileList,description,is_public,datatime,Radiovalue} =this.state; let newfileList=[]; - for(var list of fileList){ - newfileList.push(list.response.id) + + if(fileList!=undefined&&fileList.length>0){ + for(var list of fileList){ + newfileList.push(list.response.id) + } } + if(newfileList.length===0){ this.setState({ newfileListtype:true