1、在请求接口的时候请求头要添加responseType: 'blob'
2、拿到返回的文件流进行下载
const link = document.createElement("a"); //创建a标签
let blob = new Blob([response], { type: "application/vnd.ms-excel" }); // response就是
接口返回的文件流
let objectUrl = URL.createObjectURL(blob);
link.href = objectUrl;
link.download = "网点数据"; // 自定义文件名
link.click(); // 下载文件
URL.revokeObjectURL(objectUrl); // 释放内存