handleDownload(){
// const loading = this.$loading({
// lock: true,
// text: 'Loading',
// spinner: 'el-icon-loading',
// background: 'rgba(0, 0, 0, 0.7)'
// });
axios({
method: 'get',
url: process.env.VUE_APP_BASE_API + '/business/download',
responseType: 'blob',
headers: {'Authorization': 'Bearer ' + getAccessToken()}
}).then(response => {
let data = response.data
if (!data) {
return
}
let blob = new Blob([data], {
type:
"application/octet-stream;charset=utf-8"
});
let url = window.URL.createObjectURL(blob);
if ("download" in document.createElement("a")) {
const a = document.createElement("a");
a.href = url;
a.download = 'Drone_PC_Setup.exe';
a.style.display = "none";
document.body.appendChild(a);
a.click();
URL.revokeObjectURL(a.href);
document.body.removeChild(a);
} else {
navigator.msSaveBlob(blob, fileName);
}
})
}
01-07
06-19
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交