diff --git a/public/react/src/modules/courses/shixunHomework/Httpdownloads.js b/public/react/src/modules/courses/shixunHomework/Httpdownloads.js index 0ec5032c8..11bd91f6b 100644 --- a/public/react/src/modules/courses/shixunHomework/Httpdownloads.js +++ b/public/react/src/modules/courses/shixunHomework/Httpdownloads.js @@ -2,7 +2,7 @@ import {Base64} from 'js-base64'; import axios from 'axios'; -// 导出实习报告批量zip 类型 +// 导出实习报告批量zip 、xlsx 类型 export function Internshipreportsy (url,struy,types,stingtype){ axios.get((url),{responseType: 'blob'}).then((response) => { const blob = new Blob([response.data], { type: stingtype }); diff --git a/public/react/src/modules/courses/shixunHomework/Listofworks.js b/public/react/src/modules/courses/shixunHomework/Listofworks.js index fd96ea25e..f09256230 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworks.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworks.js @@ -1349,21 +1349,22 @@ class Listofworks extends Component { } axios.get(url).then((response) => { - console.log(response); - if(response.data.status&&response.data.status===-1){ - console.log("1352"); - console.log(response); - - }else if(response.data.status&&response.data.status===-2){ - console.log("1356"); - console.log(response); - }else { - if(type === 1){ - Internshipreportsy(url,struy,".zip",'application/zip'); - }else{ - Internshipreportsy(url,struy,".xlsx",'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); - } - } + if(response !== undefined){ + if(response.data.status&&response.data.status===-1){ + console.log("1352"); + console.log(response); + + }else if(response.data.status&&response.data.status===-2){ + console.log("1356"); + console.log(response); + }else { + if(type === 1){ + Internshipreportsy(url,struy,".zip",'application/zip'); + }else{ + Internshipreportsy(url,struy,".xlsx",'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); + } + } + } }).catch((error) => { console.log(error) });