diff --git a/public/react/src/modules/courses/Resource/Fileslistitem.js b/public/react/src/modules/courses/Resource/Fileslistitem.js index 6fe7fa55d..6239f1b3d 100644 --- a/public/react/src/modules/courses/Resource/Fileslistitem.js +++ b/public/react/src/modules/courses/Resource/Fileslistitem.js @@ -26,8 +26,8 @@ class Fileslistitem extends Component{ }) this.props.Settingtypes(discussMessage.id) } - showfiles=()=>{ - debugger + showfiles=(value)=>{ + let {discussMessage,coursesId}=this.props let file_id=discussMessage.id let url="/files/"+file_id+"/histories.json" @@ -42,10 +42,8 @@ class Fileslistitem extends Component{ let link = document.createElement('a'); document.body.appendChild(link); link.href = result.data.url; - let filesname=escape(result.data.title) - debugger console.log(filesname) - link.download = unescape(filesname); + link.download = value; //兼容火狐浏览器 let evt = document.createEvent("MouseEvents"); evt.initEvent("click", false, false); @@ -208,13 +206,13 @@ class Fileslistitem extends Component{ { this.props.isAdmin ? this.showfiles(discussMessage.title)} title={discussMessage.title} className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.title} : "" } { this.props.isStudent? this.showfiles(discussMessage.title)} title={discussMessage.title} className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.title} :"" }