From eb9b875454dfb246c09e336c08b88a00a43ec803 Mon Sep 17 00:00:00 2001 From: "DESKTOP-I1T6TF3\\Q" <2291969160@qq.com> Date: Wed, 3 Jun 2026 03:37:49 +0800 Subject: [PATCH] =?UTF-8?q?fix(web):=20use=20existing=20STYLE=5FMAP=20key?= =?UTF-8?q?=20for=20home=20=E3=80=8C=E8=87=AA=E5=8A=A8=E3=80=8D=20fallback?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After bed4dc5 renamed style keys to include the (Image N参考) suffix, the home start() still resolved 「自动」 against the legacy bare name 「京阿尼细腻日常」, leaving styleGuide undefined and tripping the /api/start required-field check on the default click. Fall back to "Galgame CG 梦幻光影" — a key that actually exists in STYLE_MAP — so the default path resolves cleanly without changing the behavior of explicitly selected styles. Co-Authored-By: Claude Opus 4.7 (1M context) --- app/page.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/page.tsx b/app/page.tsx index 64adca7..67e3bc3 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1057,14 +1057,15 @@ export default function HomePage() { .filter(Boolean) .join("\n"); - // 「自动」→ fall back to 二次元 (project default). Plain prompts like + // 「自动」→ fall back to Galgame CG (project default). Plain prompts like // "由模型自动判断画风" are not understood by FLUX — it just paints them // literally, so we'd rather lock in a sensible default. // TODO(自动路由): 后续实现真正的「自动」——由模型依据世界观 / 玩家 prompt - // 选出最合适的画风,再映射到对应风格提示词,而非固定回退到二次元。届时 + // 选出最合适的画风,再映射到对应风格提示词,而非固定回退到 Galgame。届时 // 同步更新风格弹窗副标题(「由模型根据 prompt 判断风格」)使文案与行为一致。 - const effectiveStyle = artStyle === "自动" ? "京阿尼细腻日常" : artStyle; - const styleGuide = STYLE_MAP[effectiveStyle] ?? STYLE_MAP["京阿尼细腻日常"]!; + const DEFAULT_STYLE = "Galgame CG 梦幻光影"; + const effectiveStyle = artStyle === "自动" ? DEFAULT_STYLE : artStyle; + const styleGuide = STYLE_MAP[effectiveStyle] ?? STYLE_MAP[DEFAULT_STYLE]!; const audioEnabled = voice === "开启"; sessionStorage.setItem(