From af12d95753a60f1e23620eeca0332d09b6cb7307 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 5 Jul 2019 22:59:00 +0800 Subject: [PATCH] b --- .../src/modules/courses/shixunHomework/Listofworks.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/shixunHomework/Listofworks.js b/public/react/src/modules/courses/shixunHomework/Listofworks.js index 2983b80a4..f06acf8ec 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworks.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworks.js @@ -1415,8 +1415,17 @@ class Listofworks extends Component { console.log("1409"); console.log(Base64.decode(response.headers['content-disposition'].split('=')[1])); const string = Base64.decode(response.headers['content-disposition'].split('=')[1]); + var now=""; + try { + now = moment().year()+moment().month()+moment().date(); + console.log("1422"); + console.log(now); + + } catch (e) { + console.log("1432"); + } downloadElement.href = href - downloadElement.download =string+".xlsx"; + downloadElement.download =string+now+".xlsx"; document.body.appendChild(downloadElement) downloadElement.click() document.body.removeChild(downloadElement) // 下载完成移除元素