axios.get('errormapmanage/downloadErrorLayer',
{
params :{
all: true,
version: queryMapversion.mapVersion
},
responseType: 'arraybuffer',
}).then(res=>{
const url = window.URL.createObjectURL(new Blob([res],
{type:'application/vnd.ms-excel'}));
const link = document.createElement('a');
link.href = url;
// const fileName = decodeURI(res.headers['filename']);
link.setAttribute('download', '全量数据111111.xlsx');
document.body.appendChild(link);
link.click();
});
接口获取数据 axios.get('errormapmanage/downloadErrorLayer',
{
params :{
all: true,
version: queryMapversion.mapVersion
},
responseType: 'arraybuffer', //规定了数据下载后的类型是buff
})