diff --git a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js index a438e78a8..dfdc6291a 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js @@ -246,9 +246,32 @@ class CoursesBanner extends Component { }) var url = `/courses/${id}/duplicate_course.json` axios.post(url).then((response) => { + if(response!==undefined){ + window.location.href = "/courses/" + response.data.new_course_id+"/students"; + }else { + this.modalCancel(); + } // window.location.href = "/courses/" + response.data.new_course_id; - window.location.href = "/courses/" + response.data.new_course_id+"/students"; - }) + + }).catch(function (error) { + this.modalCancel(); + console.log(252); + console.log(error); + }); + + // axios.interceptors.response.use((response) => { + // if (response != undefined) + // if (response && response.data.status === -1) { + // this.setState({ + // antIcon: false, + // }) + // + // } + // return response; + // }, (error) => { + // //TODO 这里如果样式变了会出现css不加载的情况 + // + // }); } if(this.state.metype===6){ diff --git a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js index 511c40d61..1041bb284 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js @@ -72,7 +72,8 @@ class ShixunStudentWork extends Component { showmodel:false, jobsettingsdata:undefined, DownloadType:false, - DownloadMessageval:undefined + DownloadMessageval:undefined, + lunxun:true, } } @@ -121,6 +122,7 @@ class ShixunStudentWork extends Component { getupdata=(pages)=>{ let {order,b_order,page,limit,group_infolist,search}=this.state; + var homeworkid = this.props.match.params.homeworkid; let url = "/homework_commons/" + homeworkid + "/code_review_results.json"; @@ -152,8 +154,17 @@ class ShixunStudentWork extends Component { this.setState({ data: response.data, datalist:datas - }) + }); } + this.setState({ + lunxun:false, + }) + }else{ + setInterval(() => { + if(this.state.lunxun===true){ + this.getupdata(); + } + }, 1000); } }