dev_forum
杨树明 5 years ago
parent 77bf53215f
commit 027dab3f9b

@ -44,20 +44,16 @@ class Fileslistitem extends Component{
document.body.appendChild(link); document.body.appendChild(link);
link.href = result.data.url; link.href = result.data.url;
console.log(newvalue) console.log(newvalue)
link.download = Base64.decode(newvalue); // link.download = Base64.decode(newvalue);
//兼容火狐浏览器 //兼容火狐浏览器
// let evt = document.createEvent("MouseEvents"); // let evt = document.createEvent("MouseEvents");
// evt.initEvent("click", false, false); // evt.initEvent("click", false, false);
// link.dispatchEvent(evt); // link.dispatchEvent(evt);
// document.body.removeChild(link); // document.body.removeChild(link);
link.style.display = 'none'; link.style.display = 'none';
link.setAttribute('download',result.data.title); link.setAttribute('download',result.data.title);
document.body.appendChild(link); document.body.appendChild(link);
link.click(); link.click();
// // window.location.href=result.data.url; // // window.location.href=result.data.url;
// let url = window.URL.createObjectURL(new Blob([result.data.url])); // let url = window.URL.createObjectURL(new Blob([result.data.url]));
// let link = document.createElement('a'); // let link = document.createElement('a');

Loading…
Cancel
Save