视频和音频的下载
export function downloadFIle(url,name){
let xhr = new XMLHttpRequest();
xhr.open('get',url, true);
xhr.responseType = 'blob';
xhr.onload = function(){
if(this.status == 200){
const blob = this.response;
const a = document.createElement('a');
const URL = window.URL || window.webkitURL;
const href = URL.createObjectURL(blob)
name = name || url.slice(url.lastIndex('/') + 1);
a.href = href;
a.download = name;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
window.URL.revokeObjectURL(href)
}
};
xhr.send();
}