From 526c87c76965eff74f3050e5925f1470b2128af9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 23 Jul 2019 10:45:16 +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/ShixunModal.js | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/ShixunModal.js b/public/react/src/modules/courses/coursesPublic/ShixunModal.js index afba47723..56cecc51b 100644 --- a/public/react/src/modules/courses/coursesPublic/ShixunModal.js +++ b/public/react/src/modules/courses/coursesPublic/ShixunModal.js @@ -29,11 +29,13 @@ class ShixunModal extends Component{ axios.get(url).then((result)=>{ if(result.status===200){ - this.setState({ - shixunmodallist:result.data, - hometypepvisible:false, - newshixunmodallist:result.data.shixun_list, - }) + if(result.data.message===undefined){ + this.setState({ + shixunmodallist:result.data, + hometypepvisible:false, + newshixunmodallist:result.data.shixun_list, + }) + } } }).catch((error)=>{ console.log(error); @@ -59,18 +61,18 @@ class ShixunModal extends Component{ } }).then((result)=>{ if(result.status===200){ + if(result.data.message===undefined){ + let shixun_list = result.data.shixun_list; + for (var i = 0; i < shixun_list.length; i++) { + newshixunmodallists.push(shixun_list[i]) + } + this.setState({ + shixunmodallist: result.data, + newshixunmodallist: newshixunmodallists, + hometypepvisible: false + }) - let shixun_list=result.data.shixun_list; - for(var i=0; i{