From f1894db89232d02dd54671733c815366a002f4fa 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 10:16:39 +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 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/courses/Resource/Fileslistitem.js b/public/react/src/modules/courses/Resource/Fileslistitem.js index 1af027757..6b68386fb 100644 --- a/public/react/src/modules/courses/Resource/Fileslistitem.js +++ b/public/react/src/modules/courses/Resource/Fileslistitem.js @@ -5,7 +5,8 @@ import {Link} from 'react-router-dom'; import {getImageUrl} from 'educoder'; import axios from 'axios' import {getUrl} from 'educoder'; -import moment from 'moment'; +import moment from 'moment' +import { Base64 } from 'js-base64'; import CoursesListType from '../coursesPublic/CoursesListType'; import Showoldfiles from "../coursesPublic/Showoldfiles"; import Modals from '../../modals/Modals'; @@ -27,7 +28,7 @@ class Fileslistitem extends Component{ this.props.Settingtypes(discussMessage.id) } showfiles=(value)=>{ - + let newvalue=Base64.encode(value) let {discussMessage,coursesId}=this.props let file_id=discussMessage.id let url="/files/"+file_id+"/histories.json" @@ -43,7 +44,7 @@ class Fileslistitem extends Component{ document.body.appendChild(link); link.href = result.data.url; console.log(value) - link.download = value; + link.download = Base64.decode(newvalue); //兼容火狐浏览器 let evt = document.createEvent("MouseEvents"); evt.initEvent("click", false, false);