From 95f92dd28486e816d5d01e45216c234591d4977a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 28 Aug 2019 10:14:52 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=AF=BE=E5=A0=82=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/Resource/index.js | 29 ++++++++++--------- .../courses/shixunHomework/shixunHomework.js | 2 +- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/public/react/src/modules/courses/Resource/index.js b/public/react/src/modules/courses/Resource/index.js index a0ba1e8da..1565f5abb 100644 --- a/public/react/src/modules/courses/Resource/index.js +++ b/public/react/src/modules/courses/Resource/index.js @@ -119,20 +119,21 @@ class Fileslists extends Component{ }).then((response) => { if(response!=undefined){ - if(response.data&&response.data){ - let list=response.data.course_modules; - let course_second_categoriess; - list.map((item,key)=>{ - course_second_categoriess=item.course_second_categories - }) - - this.setState({ - course_modules:response.data, - has_course_groups:response.data.has_course_groups, - course_second_categories:course_second_categoriess - }) - } - + if(response.data&&response.data) { + if (response.data.status != 401) { + let list = response.data.course_modules; + let course_second_categoriess; + list.map((item, key) => { + course_second_categoriess = item.course_second_categories + }) + + this.setState({ + course_modules: response.data, + has_course_groups: response.data.has_course_groups, + course_second_categories: course_second_categoriess + }) + } + } } diff --git a/public/react/src/modules/courses/shixunHomework/shixunHomework.js b/public/react/src/modules/courses/shixunHomework/shixunHomework.js index c7fa2e70a..88dffa232 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunHomework.js +++ b/public/react/src/modules/courses/shixunHomework/shixunHomework.js @@ -1210,7 +1210,7 @@ class ShixunHomework extends Component{ { - datas===undefined?'' :datas.homeworks.length===0? :"" + datas===undefined?"":datas.homeworks && datas.homeworks.length===0? :"" }