From 2293487e85f969fcaaa5b2c0da54d7b0e1a34f74 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:51:44 +0800 Subject: [PATCH] b --- public/react/src/modules/courses/Resource/Fileslistitem.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/courses/Resource/Fileslistitem.js b/public/react/src/modules/courses/Resource/Fileslistitem.js index cd46570bd..91d4738d5 100644 --- a/public/react/src/modules/courses/Resource/Fileslistitem.js +++ b/public/react/src/modules/courses/Resource/Fileslistitem.js @@ -30,13 +30,12 @@ class Fileslistitem extends Component{ downloadfiles=(url,name)=>{ const aLink = document.createElement('a'); - document.body.appendChild(aLink); aLink.style.display='none'; aLink.download =name; aLink.href = url; + document.body.appendChild(aLink); aLink.click(); - document.body.removeChild(aLink); - + // document.body.removeChild(aLink); } showfiles=(value)=>{ let {discussMessage,coursesId}=this.props @@ -49,7 +48,7 @@ class Fileslistitem extends Component{ }).then((result)=>{ if(result.data.attachment_histories.length===0){ - this.downloadfiles(result.data.url,filesname) + this.downloadfiles(result.data.url,result.data.title) }else{ this.setState({ Showoldfiles:true,