diff --git a/frontend/src/components/TaskTree/TaskFlowView.tsx b/frontend/src/components/TaskTree/TaskFlowView.tsx index 65e11c3..9c79e2b 100644 --- a/frontend/src/components/TaskTree/TaskFlowView.tsx +++ b/frontend/src/components/TaskTree/TaskFlowView.tsx @@ -28,7 +28,12 @@ function parseImages(s: any): string[] { if (typeof s === "string") { try { return JSON.parse(s); } catch { return []; } } return []; } -function imageUrl(u: string) { if (!u) return ""; return u.startsWith("http") ? u : import.meta.env.VITE_API_BASE_URL + (u.startsWith("/") ? u : "/" + u); } +function imageUrl(u: string) { + if (!u) return ""; + if (u.startsWith("http")) return u; // 绝对地址直接用 + if (u.startsWith("/api/")) return u; // 已是完整API路径,避免双重/api/v1前缀 + return import.meta.env.VITE_API_BASE_URL + (u.startsWith("/") ? u : "/" + u); +} const ALL_TASKS = new Set(); function collectAll(tasks: TaskResponse[]) { tasks.forEach(t => { ALL_TASKS.add(t); if (t.child_tasks) collectAll(t.child_tasks); }); }