dev_forum
杨树明 5 years ago
parent 2cbf3f8030
commit f38091a59a

@ -38,16 +38,16 @@ class Fileslistitem extends Component{
}).then((result)=>{ }).then((result)=>{
if(result.data.attachment_histories.length===0){ if(result.data.attachment_histories.length===0){
result.blob().then(blob => {
const aLink = document.createElement('a'); const aLink = document.createElement('a');
document.body.appendChild(aLink); document.body.appendChild(aLink);
aLink.style.display='none'; aLink.style.display='none';
const objectUrl = window.URL.createObjectURL(blob.data.url); const objectUrl = window.URL.createObjectURL(result.data.url);
aLink.href = objectUrl; aLink.href = objectUrl;
aLink.download =blob.data.title; aLink.download =result.data.title;
aLink.click(); aLink.click();
document.body.removeChild(aLink); document.body.removeChild(aLink);
});
}else{ }else{
this.setState({ this.setState({

Loading…
Cancel
Save