|
|
@@ -4,6 +4,7 @@ import './File.less'
|
|
|
import {Button, Dropdown, Menu, message} from "antd";
|
|
|
import {apiDelete, apiDownload, apiFolderList} from "../../services/API/API";
|
|
|
import getCookie from "../../utils/getCookie";
|
|
|
+import {dataURLtoFile} from "../../utils/base64ToFile";
|
|
|
|
|
|
const fileDownload = require('js-file-download');
|
|
|
|
|
|
@@ -40,7 +41,9 @@ class File extends Component {
|
|
|
// window.location.href = "";
|
|
|
} else {
|
|
|
message.success('下载开始');
|
|
|
- fileDownload(res.data, this.props.ele.file_name)
|
|
|
+ console.log(res.data.file_b64)
|
|
|
+ let file_b = dataURLtoFile(res.data.file_b64, this.props.ele.file_name)
|
|
|
+ fileDownload(file_b, this.props.ele.file_name)
|
|
|
// window.location.href = "";
|
|
|
}
|
|
|
})
|
|
|
@@ -78,12 +81,12 @@ class File extends Component {
|
|
|
const menu = (
|
|
|
<Menu>
|
|
|
<Menu.Item key="download">
|
|
|
- <Button onClick={this.handleDownload} type="dashed" icon={<CloudDownloadOutlined />}>
|
|
|
+ <Button onClick={this.handleDownload} type="dashed" icon={<CloudDownloadOutlined/>}>
|
|
|
DOWNLOAD
|
|
|
</Button>
|
|
|
</Menu.Item>
|
|
|
<Menu.Item key="delete">
|
|
|
- <Button onClick={this.handleDelete} type="dashed" icon={<DeleteOutlined />}>
|
|
|
+ <Button onClick={this.handleDelete} type="dashed" icon={<DeleteOutlined/>}>
|
|
|
DELETE
|
|
|
</Button>
|
|
|
</Menu.Item>
|