From 826998fb70d9e36bf004aed4ae63af1c706b8344 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8C=97=E6=9E=B3?= <7854742+wang_rumeng@user.noreply.gitee.com> Date: Mon, 25 Aug 2025 20:04:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9E=84=E5=BB=BA=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/video_flow.ts | 4 ++-- app/dashboard/page.tsx | 4 ++-- components/dashboard/network-timeline.tsx | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/api/video_flow.ts b/api/video_flow.ts index f106398..990c629 100644 --- a/api/video_flow.ts +++ b/api/video_flow.ts @@ -308,13 +308,13 @@ export const getProjectTaskList = async (data: { } catch (error) { clearTimeout(timeoutId); - if (error.name === 'AbortError') { + if (error instanceof Error && error.name === 'AbortError') { console.error('[API] 请求超时 (30秒)'); throw new Error('请求超时,请检查网络连接'); } console.error('[API] 获取任务列表失败:', error); - throw error; + throw error instanceof Error ? error : new Error('未知错误'); } }; diff --git a/app/dashboard/page.tsx b/app/dashboard/page.tsx index ed467e8..7cfcec1 100644 --- a/app/dashboard/page.tsx +++ b/app/dashboard/page.tsx @@ -451,7 +451,7 @@ export default function DashboardPage() { console.log('重试任务:', taskId); try { // 1. 乐观更新:立即更新任务状态为重试中 - setDashboardData(prevData => { + setDashboardData((prevData: any[]) => { if (!Array.isArray(prevData)) return prevData; return prevData.map(task => { @@ -460,7 +460,7 @@ export default function DashboardPage() { } // 检查子任务 if (task.sub_tasks && Array.isArray(task.sub_tasks)) { - const updatedSubTasks = task.sub_tasks.map(subTask => + const updatedSubTasks = task.sub_tasks.map((subTask: { task_id: string; task_status: string }) => subTask.task_id === taskId ? { ...subTask, task_status: 'RETRYING' } : subTask diff --git a/components/dashboard/network-timeline.tsx b/components/dashboard/network-timeline.tsx index f9d4f14..df30b93 100644 --- a/components/dashboard/network-timeline.tsx +++ b/components/dashboard/network-timeline.tsx @@ -89,7 +89,7 @@ export function NetworkTimeline({ } // 检查子任务 if (task.sub_tasks && Array.isArray(task.sub_tasks)) { - return task.sub_tasks.some(subTask => + return task.sub_tasks.some((subTask: { task_id: string; task_status: string }) => subTask.task_id === taskId && subTask.task_status === 'RETRYING' ); }