From d748306ab3eedb752f9533588b5c05fed4405f3e Mon Sep 17 00:00:00 2001 From: Timothy Yin Date: Mon, 27 Oct 2025 09:50:54 +0800 Subject: [PATCH] =?UTF-8?q?fix(CGTaskCard):=20=E5=90=88=E6=88=90=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E6=97=B6=E4=BD=BF=E7=94=A8=E6=9C=80=E6=96=B0=E7=9A=84?= =?UTF-8?q?=E5=AD=97=E5=B9=95=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../aigc/generation/CGTaskCard.client.vue | 18 ++++++++++++++++-- package.json | 2 +- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/components/aigc/generation/CGTaskCard.client.vue b/components/aigc/generation/CGTaskCard.client.vue index e41dc7a..3304adf 100644 --- a/components/aigc/generation/CGTaskCard.client.vue +++ b/components/aigc/generation/CGTaskCard.client.vue @@ -145,10 +145,24 @@ const copyTaskId = (extraMessage?: string) => { const isCombinationModalOpen = ref(false) const combinationState = ref<0 | 1 | undefined>(0) -const onCombination = () => { +const onCombination = async () => { isCombinationModalOpen.value = true combinationState.value = undefined - useVideoSubtitleEmbedding(props.course.video_url, props.course.subtitle_url) + const srtResponse = await ( + await fetch(await fetchCourseSubtitleUrl(props.course)) + ).blob() + if (!srtResponse) { + toast.add({ + title: '获取字幕失败', + description: '无法获取字幕文件,请稍后重试', + color: 'red', + icon: 'i-tabler-alert-triangle', + }) + return + } + const srtBlob = new Blob([srtResponse], { type: 'text/plain' }) + const srtUrl = URL.createObjectURL(srtBlob) + useVideoSubtitleEmbedding(props.course.video_url, srtUrl) .then((src) => { startDownload( src, diff --git a/package.json b/package.json index 18cbd11..4a553ec 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "preview": "nuxt preview", "postinstall": "nuxt prepare" }, - "packageManager": "pnpm@9.1.3", + "packageManager": "pnpm@10.19.0", "dependencies": { "@iconify-json/line-md": "^1.1.38", "@iconify-json/solar": "^1.1.9",