一:a标签或通过点击事件创建a标签下载
<a href=“url” download=“name”>下载</a>
二:构建 blob 的方式
fetch(‘http://.......(文件的url)..........url’, {
credentials: 'include',
}).then(res => res.blob().then(blob => {
const a = document.createElement('a');
const url = window.URL.createObjectURL(blob);
a.href = url;
a.download = url;
a.click();
window.URL.revokeObjectURL(url);
}))