From b66c366a082bc0e4df4fa7055267983de9881afe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=BB=BA=E6=AD=A6?= Date: Tue, 29 Apr 2025 22:11:44 +0800 Subject: [PATCH] =?UTF-8?q?refactor(HomePage):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E7=AC=94=E8=AE=B0=E8=A1=A8=E5=8D=95=E6=8F=90=E4=BA=A4=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改 isGenerating 函数逻辑,增加对任务状态的判断 - 在 onSubmit 函数中添加成功提交任务的提示信息 --- BillNote_frontend/src/pages/HomePage/components/NoteForm.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/BillNote_frontend/src/pages/HomePage/components/NoteForm.tsx b/BillNote_frontend/src/pages/HomePage/components/NoteForm.tsx index 7033464..476945f 100644 --- a/BillNote_frontend/src/pages/HomePage/components/NoteForm.tsx +++ b/BillNote_frontend/src/pages/HomePage/components/NoteForm.tsx @@ -156,7 +156,7 @@ const NoteForm = () => { } const isGenerating = () => { console.log('🚀 isGenerating', getCurrentTask()?.status) - return getCurrentTask()?.status === 'PENDING' + return getCurrentTask()?.status != 'SUCCESS' && getCurrentTask()?.status != 'FAILED' && getCurrentTask()?.status != undefined } const handleFileUpload = async (file: File, onSuccess: (url: string) => void) => { if (!file) return @@ -179,6 +179,8 @@ const NoteForm = () => { // TODO 修复选择其他视频平台以后再选择本地视频还可以选择 Link 的问题 const onSubmit = async (data: NoteFormValues) => { console.log('🎯 提交内容:', data) + message.success('提交任务') + const payload = { video_url: data.video_url, platform: data.platform,