From 4b8e07cfe2028478f0b23521ea3019aeafa00232 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 12:36:16 +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 --- public/react/src/modules/courses/Resource/Fileslistitem.js | 4 +++- public/react/src/modules/courses/Resource/index.js | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/courses/Resource/Fileslistitem.js b/public/react/src/modules/courses/Resource/Fileslistitem.js index ae7f2f092..323d9d724 100644 --- a/public/react/src/modules/courses/Resource/Fileslistitem.js +++ b/public/react/src/modules/courses/Resource/Fileslistitem.js @@ -40,8 +40,10 @@ class Fileslistitem extends Component{ let link = document.createElement('a'); // link.href = window.URL.createObjectURL(new Blob([result.data.url])); link.href = result.data.url; - // link.download = encodeURI(result.data.title); + console.log(result.data.title) + link.download = result.data.title; //兼容火狐浏览器 + console.log(result.data.title) document.body.appendChild(link); let evt = document.createEvent("MouseEvents"); evt.initEvent("click", false, false); diff --git a/public/react/src/modules/courses/Resource/index.js b/public/react/src/modules/courses/Resource/index.js index c42d8e09b..07731686e 100644 --- a/public/react/src/modules/courses/Resource/index.js +++ b/public/react/src/modules/courses/Resource/index.js @@ -687,9 +687,9 @@ class Fileslists extends Component{