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);