diff --git a/frontend/src/components/YtAssignPanel.tsx b/frontend/src/components/YtAssignPanel.tsx index 9654eac..f46aa53 100644 --- a/frontend/src/components/YtAssignPanel.tsx +++ b/frontend/src/components/YtAssignPanel.tsx @@ -117,6 +117,13 @@ function exportText(rows: Array<{ url?: string; title?: string }>): string { .join("\n"); } +function copyUrlText(rows: Array<{ url?: string }>): string { + return rows + .map((r) => String(r.url || "").trim()) + .filter(Boolean) + .join("\n"); +} + async function copyText(text: string): Promise { try { await navigator.clipboard.writeText(text); @@ -613,7 +620,7 @@ export function YtAssignPanel({ channels }: { channels: ManagedChannel[] }) { ? (selected.featured || []).map((f) => ({ url: f.url, title: f.title })) : (selected.slots || []).map((s) => ({ url: s.url, title: s.title })); const label = kind === "pool" ? "普通" : kind === "featured" ? "精选" : "时间段"; - const text = exportText(rows); + const text = copyUrlText(rows); if (!text) { toast.push("列表为空", "err"); return;