轻应用主题参数:随当前主题色映射传值

- 主题参数改为按系统主题(red/dark-blue)映射取目标应用对应的值
- 应用管理弹窗用结构化映射编辑器(逐主题色配置目标值,默认同名)
- iframe 嵌套显式传入当前主题色,切主题时 src 重建
- 读取/保存时规范化映射串;解析支持 light/dark 等别名,取不到回退主题色名而非恒为 red

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
fengxiangdebaoziandClaude Opus 4.8 committed 2026-06-12 22:30:31 +08:00
1 parent a7596001c5
commit 74324f4585
4 files changed
+41 -12

No files matched your search

@@ -16,6 +16,7 @@ import {
import { apiFetch } from "@/core/api/fetch-client";
import { getBackendBaseURL } from "@/core/config";
import { parseThemeMap, stringifyThemeMap } from "@/strategy-components/lib/light-app";
export type LightAppType = "window_open" | "iframe";
export type RouteParamType = "login" | "theme";
@@ -104,7 +105,12 @@ function toApp(s: ServerApp): LightApp {
paramType: p.paramType,
source: p.source ?? null,
customValue: p.customValue ?? null,
themeValue: p.themeValue ?? null,
// 主题参数读取时规范化为完整映射串(red=..;blue=..;dark-blue=..),
// 让旧的纯值/部分映射也能随主题切换,无需重新保存。
themeValue:
p.paramType === "theme"
? stringifyThemeMap(parseThemeMap(p.themeValue))
: (p.themeValue ?? null),
})),
mountLocation: s.mount_location ?? null,
icon: s.icon ?? null,