diff --git a/public/react/src/modules/courses/shixunHomework/Listofworks.js b/public/react/src/modules/courses/shixunHomework/Listofworks.js index 7fea77b35..9ea5bc78a 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworks.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworks.js @@ -1349,11 +1349,13 @@ class Listofworks extends Component { axios.get(url).then((response) => { console.log("1350"); console.log(response); - if(response.data.status === 200){ - window.open("/api"+url, '_blank'); + if(response.data.status&&response.data.status===-1){ - }else{ + }else if(response.data.status&&response.data.status===-2){ + + }else{ + window.open("/api"+url, '_blank'); } }).catch((error) => { console.log(error) @@ -1374,7 +1376,12 @@ class Listofworks extends Component { axios.get(url).then((response) => { console.log("1374"); console.log(response); - if(response.data.status=== 200){ + if(response.data.status&&response.data.status===-1){ + + + }else if(response.data.status&&response.data.status===-2){ + + }else{ window.open("/api"+url, '_blank'); } diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index f67eca6ab..0afd9ff4d 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -1608,21 +1608,20 @@ class Trainingjobsetting extends Component { }) } // 导出实习报告批量 - internshipreport = () => { + internshipreport = (url) => { console.log("internshipreport"); - var homeworkid = this.props.match.params.homeworkid; - let url = "/zip/shixun_report"; - axios.get((url),{ - params: { - homework_common_id: homeworkid, - } - },{responseType: 'blob'}).then((response) => { + // var homeworkid = this.props.match.params.homeworkid; + // let url = "/zip/shixun_report"; + axios.get(url).then((response) => { console.log("326"); console.log(response); - if(response.status === 200){ - window.open(url, '_blank'); - }else{ + if(response.data.status&&response.data.status===-1){ + + + }else if(response.data.status&&response.data.status===-2){ + }else{ + window.open("/api"+url, '_blank'); } }).catch((error) => { @@ -1631,19 +1630,22 @@ class Trainingjobsetting extends Component { } // 课堂学生成绩的导出下载 - Classstudentachievement = () => { + Classstudentachievement = (url) => { console.log("Classstudentachievement"); - const course_id = this.props.match.params.coursesId; - let url = "/courses/" + course_id + "/export_member_scores_excel.xlsx"; - axios.get((url),{responseType: 'blob'}).then((response) => { - console.log("339"); + // const course_id = this.props.match.params.coursesId; + // let url = "/courses/" + course_id + "/export_member_scores_excel.xlsx"; + axios.get(url).then((response) => { + console.log("1374"); console.log(response); - if(response.status === 200){ - window.open(url, '_blank'); + if(response.data.status&&response.data.status===-1){ + + + }else if(response.data.status&&response.data.status===-2){ + }else{ + window.open("/api"+url, '_blank'); } - }).catch((error) => { console.log(error) }); @@ -1789,9 +1791,9 @@ class Trainingjobsetting extends Component { {this.props.isAdmin() ?