fix downloading

This commit is contained in:
jxxghp
2023-07-02 18:26:56 +08:00
parent 67b21d60f7
commit 90587608f8
+4 -6
View File
@@ -25,13 +25,11 @@ const isDownloading = ref(props.info?.state === "downloading" ? true : false);
// 下载状态控制 // 下载状态控制
const toggleDownload = async () => { const toggleDownload = async () => {
let operation = isDownloading.value ? "pause" : "start"; let operation = isDownloading.value ? "stop" : "start";
try { try {
const result: { [key: string]: any } = await api.put(`download/${props.info?.hash}`, { const result: { [key: string]: any } = await api.put(
params: { `download/${props.info?.hash}/${operation}`
open: operation, );
},
});
isDownloading.value = !isDownloading.value; isDownloading.value = !isDownloading.value;
} catch (error) { } catch (error) {
console.error(error); console.error(error);