fix(appearance): 生效值合成统一紧凑编码——级联命中的 ThemeState JSON 转回 theme|0|1|1 形态
build / build-push (push) Successful in 53s

线上验证发现:readThemeWithFallback 返回 ThemeState JSON(schTheme 端点口径),而 oapi 契约/init
收敛只认紧凑编码——层间编码不一致会让学校/平台档被 init 当脏值跳过。合成层补 encodeThemeState
转换(读侧宽松:转换失败降 null 不抛)。
This commit is contained in:
chenxing
2026-10-09 00:26:40 +08:00
parent 0ac521f286
commit 8b3f8afd77
2 changed files with 14 additions and 4 deletions
@@ -125,7 +125,16 @@ public class AppearanceServiceImpl implements IAppearanceService {
String avatar = myAvatar;
try {
if (theme == null) {
theme = schSettingsService.readThemeWithFallback(schId).getValue();
// readThemeWithFallback 命中值是 ThemeState JSON(schTheme 端点口径);oapi 契约统一出
// 紧凑编码(init 侧 compactThemeToJson 只认紧凑形态),脏值宽松降 null 不抛
String hit = schSettingsService.readThemeWithFallback(schId).getValue();
if (hit != null) {
try {
theme = ThemeCodec.encodeThemeState(hit);
} catch (DException e) {
theme = null;
}
}
}
if (avatar == null) {
avatar = schSettingsService.readAvatarWithFallback(schId).getValue();