diff --git a/public/react/src/modules/courses/Resource/Fileslistitem.js b/public/react/src/modules/courses/Resource/Fileslistitem.js index 563724040..b65297884 100644 --- a/public/react/src/modules/courses/Resource/Fileslistitem.js +++ b/public/react/src/modules/courses/Resource/Fileslistitem.js @@ -42,7 +42,7 @@ class Fileslistitem extends Component{ //预览pdf axios({ method:'get', - url:result.data.url, + url:"http:"+window.location.host+result.data.url, responseType: 'arraybuffer', }).then((result)=>{ var binaryData = []; @@ -53,7 +53,7 @@ class Fileslistitem extends Component{ }else{ let link = document.createElement('a'); document.body.appendChild(link); - link.href = "/api"+result.data.url; + link.href = result.data.url; link.download = result.data.title; //兼容火狐浏览器 let evt = document.createEvent("MouseEvents"); diff --git a/public/react/src/modules/courses/coursesPublic/Showoldfiles.js b/public/react/src/modules/courses/coursesPublic/Showoldfiles.js index 483768271..2c682ec19 100644 --- a/public/react/src/modules/courses/coursesPublic/Showoldfiles.js +++ b/public/react/src/modules/courses/coursesPublic/Showoldfiles.js @@ -45,7 +45,7 @@ class Showoldfiles extends Component{ showfiless=(url)=>{ axios({ method:'get', - url:url, + url:"http:"+window.location.host+url, responseType: 'arraybuffer', }).then((result)=>{ var binaryData = []; @@ -188,7 +188,7 @@ class Showoldfiles extends Component{