标签:console lin 解决乱码 header get create ref div ica
axios.get("URL",{
params:{
data1:data1,
data2:data2
},
headers: { ‘Content-Type‘: ‘application/json,charset=utf-8‘},
responseType: ‘arraybuffer‘, //二进制流
}
).then(res => {
console.log(res);
let blob = new Blob([res], { type: ‘application/vnd.ms-excel,charset=utf-8‘ });
let url =window.URL.createObjectURL(blob);
let link = document.createElement(‘a‘);
link.download = ‘name.xlsx‘;
link.href = url;
link.click();
})
axios 请求接口获取文件流数据导出数据到excel,解决乱码
标签:console lin 解决乱码 header get create ref div ica
原文地址:https://www.cnblogs.com/yaomin/p/10821065.html