diff --git a/src/component/FileManager/ContextMenu.js b/src/component/FileManager/ContextMenu.js index ff4beec..dab90a4 100644 --- a/src/component/FileManager/ContextMenu.js +++ b/src/component/FileManager/ContextMenu.js @@ -132,7 +132,7 @@ class ContextMenuCompoment extends Component { } this.props.changeContextMenu("file",false); let downloadPath = this.props.selected[0].path === "/" ? this.props.selected[0].path+this.props.selected[0].name:this.props.selected[0].path+"/"+this.props.selected[0].name; - window.open(baseURL+"/file"+(downloadPath)); + window.open(baseURL+"/file/download"+(downloadPath)); } diff --git a/src/component/FileManager/FileIcon.js b/src/component/FileManager/FileIcon.js index fb66c45..5681594 100644 --- a/src/component/FileManager/FileIcon.js +++ b/src/component/FileManager/FileIcon.js @@ -12,7 +12,7 @@ import {FileWordBox,FilePowerpointBox,FileExcelBox,ScriptText,MagnetOn,ZipBox,Wi import { LazyLoadImage } from 'react-lazy-load-image-component'; import ContentLoader from 'react-content-loader' import {mediaType} from "../../config" - +import {baseURL} from "../../middleware/Api" import { withStyles, ButtonBase, Typography, Divider, Tooltip } from '@material-ui/core'; const styles = theme => ({ @@ -64,6 +64,7 @@ const styles = theme => ({ height:"150px", width:"100%", borderRadius: "6px 6px 0 0", + backgroundColor: theme.palette.background.default, }, previewIcon:{ overflow: "hidden", @@ -74,8 +75,9 @@ const styles = theme => ({ paddingTop:"50px", }, picPreview:{ - "height": "auto", - "width": "100%", + "height": "100%", + "width": "auto", + flex: "none", }, fileInfo:{ height:"50px", @@ -186,6 +188,8 @@ const styles = theme => ({ }, loadingAnimation:{ borderRadius: "6px 6px 0 0", + height: "100%", + width: "100%", }, shareFix:{ marginLeft: "20px", @@ -283,7 +287,7 @@ class FileIconCompoment extends Component { [classes.hide]:this.state.loading, [classes.picPreview]:!this.state.loading, })} - src={window.apiURL.imgThumb+"?isImg=true&path="+encodeURIComponent(this.props.file.path==="/"?this.props.file.path+this.props.file.name:this.props.file.path+"/"+this.props.file.name)} + src={baseURL+"/file/thumb/"+this.props.file.id} afterLoad = {()=>this.setState({loading:false})} beforeLoad = {()=>this.setState({loading:true})} onError={()=>this.setState({showPicIcon:true})} diff --git a/src/component/FileManager/ImgPreview.js b/src/component/FileManager/ImgPreview.js index 3f14ccd..7e6ebf8 100644 --- a/src/component/FileManager/ImgPreview.js +++ b/src/component/FileManager/ImgPreview.js @@ -48,7 +48,7 @@ class ImgPreviewCompoment extends Component { title: value.name, src: baseURL + - "/file" + + "/file/download" + (value.path === "/" ? value.path + value.name : value.path + "/" + value.name) diff --git a/src/component/Navbar.js b/src/component/Navbar.js index e26531c..61c8eea 100644 --- a/src/component/Navbar.js +++ b/src/component/Navbar.js @@ -72,6 +72,7 @@ import { Tooltip, } from '@material-ui/core'; import Auth from "../middleware/Auth" +import {baseURL} from "../middleware/Api" const drawerWidth = 240; const drawerWidthMobile = 270; @@ -353,7 +354,7 @@ class NavbarCompoment extends Component { return; } let downloadPath = this.props.selected[0].path === "/" ? this.props.selected[0].path+this.props.selected[0].name:this.props.selected[0].path+"/"+this.props.selected[0].name; - window.open(window.apiURL.download+"?action=download&path="+encodeURIComponent(downloadPath)); + window.open(baseURL+"/file/download"+downloadPath); } render() {