From f38091a59a549ebd7fb8f101806313c981fcf9bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 6 Jul 2019 13:13:09 +0800 Subject: [PATCH] b --- .../modules/courses/Resource/Fileslistitem.js | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/public/react/src/modules/courses/Resource/Fileslistitem.js b/public/react/src/modules/courses/Resource/Fileslistitem.js index d068e86df..68d0f7542 100644 --- a/public/react/src/modules/courses/Resource/Fileslistitem.js +++ b/public/react/src/modules/courses/Resource/Fileslistitem.js @@ -38,16 +38,16 @@ class Fileslistitem extends Component{ }).then((result)=>{ if(result.data.attachment_histories.length===0){ - result.blob().then(blob => { - const aLink = document.createElement('a'); - document.body.appendChild(aLink); - aLink.style.display='none'; - const objectUrl = window.URL.createObjectURL(blob.data.url); - aLink.href = objectUrl; - aLink.download =blob.data.title; - aLink.click(); - document.body.removeChild(aLink); - }); + + const aLink = document.createElement('a'); + document.body.appendChild(aLink); + aLink.style.display='none'; + const objectUrl = window.URL.createObjectURL(result.data.url); + aLink.href = objectUrl; + aLink.download =result.data.title; + aLink.click(); + document.body.removeChild(aLink); + }else{ this.setState({