常见前端下载 文件流下载
handleDownload(file) {
let url = process.env.VUE_APP_BASE_API + "/yckf/download?id=" + encodeURI(this.row.standardTaskId);
axios({
method: "get",
url,
responseType: "blob",
headers: { Authorization: "Bearer " + getToken() },
}).then(async (res) => {
const blob = new Blob([res.data], {
type: "octet/stream",
responseType: "arraybuffer",
});
saveAs(blob, decodeURI(file.name));
});
},