上个星期碰到了在IE浏览器上无法下载文件但是在谷歌上面却可以的问题,下面是我的代码:
function fetchPost(url, data, fileName) {
fetch(url,
{
method: 'POST',
body: data,
})
.then(response => {
if (response.ok) {
return response.blob(); // 处理二进制数据流,返回blob对象
}
else {
return Promise.reject(response);
}
})
.then(blob => {
let url = window.<