fetch(下载的地址)
.then(async (res) => await res.blob())
.then((blob) => {
const a = document.createElement('a');
a.style.display = 'none';
a.href = URL.createObjectURL(blob);
a.download = 下载后的名字;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
});
11-17
1063
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
10-02
4504
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)