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' ); }