Update: FileDialog download method

This commit is contained in:
2021-11-25 23:33:35 +08:00
parent 85a6c2b859
commit d8470d0f4b

View File

@@ -9,16 +9,20 @@ function FileDialog(props) {
let navigate = useNavigate();
const downloadURL = "/api/v1/get_file_direct?id=" + props.file.id;
return (
<dialog open={props.showStatus}>
<p>{props.file.filename}</p>
<p>
Download 使用 Axios 异步下载
Download 使用浏览器下载原文件
<br />
Play 调用网页播放器播放
<br />
</p>
<button>Download</button>
<a href={downloadURL} download>
<button>Download</button>
</a>
<button
onClick={() => {
props.setPlayingFile(props.file);