fix downloading

This commit is contained in:
jxxghp
2023-07-02 18:26:56 +08:00
parent 67b21d60f7
commit 90587608f8

View File

@@ -25,13 +25,11 @@ const isDownloading = ref(props.info?.state === "downloading" ? true : false);
// 下载状态控制
const toggleDownload = async () => {
let operation = isDownloading.value ? "pause" : "start";
let operation = isDownloading.value ? "stop" : "start";
try {
const result: { [key: string]: any } = await api.put(`download/${props.info?.hash}`, {
params: {
open: operation,
},
});
const result: { [key: string]: any } = await api.put(
`download/${props.info?.hash}/${operation}`
);
isDownloading.value = !isDownloading.value;
} catch (error) {
console.error(error);