From 40234133e3f176b7b933e8564dee270d7dcbc962 Mon Sep 17 00:00:00 2001 From: Noah Date: Sun, 13 Sep 2026 15:40:03 +0000 Subject: [PATCH] =?UTF-8?q?fix(webui):=20=E4=BF=9D=E5=AD=98=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E8=A6=86=E5=86=99=E6=97=B6=E4=BF=9D=E7=95=99=E6=8A=95?= =?UTF-8?q?=E7=A8=BF=E6=A8=A1=E6=9D=BF=E5=85=B3=E8=81=94=20(#1685)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 覆写弹窗的 entity 白名单漏了 upload_streamers_id,PUT 整行覆盖后外键变 NULL,后续录像不再投稿并走默认 rm。 --- app/lib/api-streamer.ts | 2 ++ app/ui/OverrideModal.tsx | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/app/lib/api-streamer.ts b/app/lib/api-streamer.ts index f7daead..9a31d40 100644 --- a/app/lib/api-streamer.ts +++ b/app/lib/api-streamer.ts @@ -99,7 +99,9 @@ export interface LiveStreamerEntity { filename: string; split_time?: number; split_size?: number; + filename_prefix?: string; upload_id?: number; + upload_streamers_id?: number | null; status?: string; upload_status?: string; statusTag?: React.ReactNode; diff --git a/app/ui/OverrideModal.tsx b/app/ui/OverrideModal.tsx index d0b0f1e..127afa3 100644 --- a/app/ui/OverrideModal.tsx +++ b/app/ui/OverrideModal.tsx @@ -92,9 +92,11 @@ const OverrideModal: React.FC = ({ children, entity, onOk }) 'url', 'remark', 'filename', + 'filename_prefix', 'split_time', 'split_size', 'upload_id', + 'upload_streamers_id', 'status', 'format', 'time_range', @@ -124,7 +126,6 @@ const OverrideModal: React.FC = ({ children, entity, onOk }) const overrideConfig = { ...(values.override || {}) } Object.keys(values).forEach(key => { - console.log(key, values[key]) if (!entityFields.has(key)) { if (values[key] !== undefined) { overrideConfig[key] = values[key] === '' ? null : values[key] @@ -134,8 +135,18 @@ const OverrideModal: React.FC = ({ children, entity, onOk }) }) values.override = overrideConfig + // PUT /v1/streamers 会按整行覆盖。漏掉 upload_streamers_id 会被写成 NULL, + // 之后录像走默认 rm 且不再投稿。以当前行打底,再叠表单字段。 + const payload = { + ...entity, + ...values, + override: overrideConfig, + upload_streamers_id: + values.upload_streamers_id ?? entity?.upload_streamers_id ?? null, + } + // 处理循环引用 - const cleanValues = removeCircularReferences(values) + const cleanValues = removeCircularReferences(payload) await onOk(cleanValues) setVisible(false) return