dev_forum
杨树林 5 years ago
parent 153e0de4c9
commit febb200243

@ -2,7 +2,7 @@ import {Base64} from 'js-base64';
import axios from 'axios'; import axios from 'axios';
// 导出实习报告批量zip 类型 // 导出实习报告批量zip 、xlsx 类型
export function Internshipreportsy (url,struy,types,stingtype){ export function Internshipreportsy (url,struy,types,stingtype){
axios.get((url),{responseType: 'blob'}).then((response) => { axios.get((url),{responseType: 'blob'}).then((response) => {
const blob = new Blob([response.data], { type: stingtype }); const blob = new Blob([response.data], { type: stingtype });

@ -1349,21 +1349,22 @@ class Listofworks extends Component {
} }
axios.get(url).then((response) => { axios.get(url).then((response) => {
console.log(response); if(response !== undefined){
if(response.data.status&&response.data.status===-1){ if(response.data.status&&response.data.status===-1){
console.log("1352"); console.log("1352");
console.log(response); console.log(response);
}else if(response.data.status&&response.data.status===-2){ }else if(response.data.status&&response.data.status===-2){
console.log("1356"); console.log("1356");
console.log(response); console.log(response);
}else { }else {
if(type === 1){ if(type === 1){
Internshipreportsy(url,struy,".zip",'application/zip'); Internshipreportsy(url,struy,".zip",'application/zip');
}else{ }else{
Internshipreportsy(url,struy,".xlsx",'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); Internshipreportsy(url,struy,".xlsx",'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
} }
} }
}
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}); });

Loading…
Cancel
Save