From ddad5986dc4791dad699021b6440e699bd111837 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 3 Jul 2019 23:55:20 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/Resource/Fileslistitem.js | 8 ++------ .../modules/courses/shixunHomework/ShixunhomeWorkItem.js | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/public/react/src/modules/courses/Resource/Fileslistitem.js b/public/react/src/modules/courses/Resource/Fileslistitem.js index 382283fee..a2f57a8e1 100644 --- a/public/react/src/modules/courses/Resource/Fileslistitem.js +++ b/public/react/src/modules/courses/Resource/Fileslistitem.js @@ -38,14 +38,10 @@ class Fileslistitem extends Component{ if(result.data.attachment_histories.length===0){ let link = document.createElement('a'); - // link.href = window.URL.createObjectURL(new Blob([result.data.url])); + document.body.appendChild(link); link.href = result.data.url; - let filesname=encodeURIComponent(result.data.title) - console.log(result.data.title) - link.download = decodeURIComponent(filesname) + link.download = result.data.title; //兼容火狐浏览器 - console.log(result.data.title) - document.body.appendChild(link); let evt = document.createEvent("MouseEvents"); evt.initEvent("click", false, false); link.dispatchEvent(evt); diff --git a/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js b/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js index aaf02498b..5731c3b73 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js @@ -360,7 +360,7 @@ class ShixunhomeWorkItem extends Component{ {this.props.isAdmin?
实训详情 - {this.props.isClassManagement?this.editname(discussMessage.name,discussMessage.homework_id)} className={"btn colorblue ml20 font-16"}>重命名:""} + {this.props.isAdminOrTeacher()?this.editname(discussMessage.name,discussMessage.homework_id)} className={"btn colorblue ml20 font-16"}>重命名:""} 设置
:""}