From 6dbc3f4babf62cc420e20889bba2796186edfc1d Mon Sep 17 00:00:00 2001 From: wumode Date: Fri, 13 Jun 2025 08:50:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=97=A0=E6=B3=95=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E9=9D=9E=E9=BB=98=E8=AE=A4=E4=B8=8B=E8=BD=BD=E5=99=A8=E7=8A=B6?= =?UTF-8?q?=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/cards/DownloadingCard.vue | 9 +++++++-- src/views/reorganize/DownloadingListView.vue | 7 ++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/components/cards/DownloadingCard.vue b/src/components/cards/DownloadingCard.vue index 6a098fa6..3647d40b 100644 --- a/src/components/cards/DownloadingCard.vue +++ b/src/components/cards/DownloadingCard.vue @@ -6,6 +6,7 @@ import { formatFileSize } from '@/@core/utils/formatters' // 输入参数 const props = defineProps({ info: Object as PropType, + downloaderName: String, }) // 是否显示卡片 @@ -51,7 +52,11 @@ function getTextClass() { async function toggleDownload() { const operation = isDownloading.value ? 'stop' : 'start' try { - const result: { [key: string]: any } = await api.get(`download/${operation}/${props.info?.hash}`) + const result: { [key: string]: any } = await api.get(`download/${operation}/${props.info?.hash}`, { + params: { + name: props.downloaderName + } + }) if (result.success) isDownloading.value = !isDownloading.value } catch (error) { @@ -62,7 +67,7 @@ async function toggleDownload() { // 删除下截 async function deleteDownload() { try { - await api.delete(`download/${props.info?.hash}`) + await api.delete(`download/${props.info?.hash}`, {params: {name: props.downloaderName}}) cardState.value = false } catch (error) { console.error(error) diff --git a/src/views/reorganize/DownloadingListView.vue b/src/views/reorganize/DownloadingListView.vue index 6c4ba480..daf66b0f 100644 --- a/src/views/reorganize/DownloadingListView.vue +++ b/src/views/reorganize/DownloadingListView.vue @@ -79,7 +79,12 @@ onUnmounted(() => {
- +