feat(appearance): /oapi/appearance 出参摘除 logoText(子应用 header 定稿只出 logo 图,门户文字走 /api/schLogoText 自有链;init 侧缺失字段自动清 yh-logo-text)——出参恰三字段 {theme,avatar,logoUrl},测试对齐
build / build-push (push) Successful in 2m14s
build / build-push (push) Successful in 2m14s
This commit is contained in:
@@ -16,7 +16,8 @@ import java.util.Map;
|
||||
* 强制(/oapi/* 无签名 401);appKey 准入归网关台账/限流管,本应用不维护 per-app 白名单。
|
||||
*
|
||||
* <p>出参 = 当前用户【生效值】{@code {theme, avatar, logoUrl}}(个人 → 学校 → 平台级联合成,
|
||||
* 层级知识留在 UserHome 内部不外露;null=未配置,消费端 init 侧清对应本地键回落默认观感)。
|
||||
* 层级知识留在 UserHome 内部不外露;null=未配置,消费端 init 侧清对应本地键回落默认观感;
|
||||
* logoText 已于 2026-10-09 定稿摘除——子应用不再消费 LOGO 文字,门户走 /api/schLogoText 自有链)。
|
||||
* 返回裸 payload(平台 oapi 无信封包装),消费端整体透传给浏览器。</p>
|
||||
*/
|
||||
@RestController
|
||||
|
||||
@@ -89,9 +89,11 @@ public class AppearanceServiceImpl implements IAppearanceService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 当前用户生效外观(oapi 代理轮 2026-10-08,{@code /oapi/appearance} 出参真源;2026-10-09 JSON 化+LOGO 文字):
|
||||
* {@code {theme, avatar, logoText, logoUrl}}——theme 为【JSON 对象】(个人自选 → 学校默认 → 平台默认(schId=0)
|
||||
* 级联,层级知识留在 UserHome 内部,对外不拆 my/sch);avatar 为生效样式;logoText 本校→平台级联;
|
||||
* 当前用户生效外观(oapi 代理轮 2026-10-08,{@code /oapi/appearance} 出参真源;2026-10-09 JSON 化;
|
||||
* 同日定稿摘除 logoText——子应用 header 定稿只出 logo 图,文字仅门户消费且走 /api/schLogoText 自有链,
|
||||
* init 侧对缺失字段按 null 语义自动清 yh-logo-text 本地键):
|
||||
* {@code {theme, avatar, logoUrl}}——theme 为【JSON 对象】(个人自选 → 学校默认 → 平台默认(schId=0)
|
||||
* 级联,层级知识留在 UserHome 内部,对外不拆 my/sch);avatar 为生效样式;
|
||||
* logoUrl 为本校 type=1 → 平台 type=0 择优。
|
||||
*
|
||||
* <p>schId 解析走本地 user_current_role(oapi 入参只有 userId,不引 identity 跨仓):roleId 当前角色学校,
|
||||
@@ -103,7 +105,6 @@ public class AppearanceServiceImpl implements IAppearanceService {
|
||||
Map<String, Object> out = new HashMap<>();
|
||||
out.put("theme", null);
|
||||
out.put("avatar", null);
|
||||
out.put("logoText", null);
|
||||
out.put("logoUrl", null);
|
||||
if (userId == null) {
|
||||
return out;
|
||||
@@ -132,10 +133,9 @@ public class AppearanceServiceImpl implements IAppearanceService {
|
||||
if (avatar == null) {
|
||||
avatar = schSettingsService.readAvatarWithFallback(schId).getValue();
|
||||
}
|
||||
out.put("logoText", schSettingsService.readLogoTextWithFallback(schId).getValue());
|
||||
out.put("logoUrl", resolveLogoUrl(schId));
|
||||
} catch (Exception e) {
|
||||
// 学校/平台段降级:theme/avatar/logoText/logoUrl 保持已得值或 null
|
||||
// 学校/平台段降级:theme/avatar/logoUrl 保持已得值或 null
|
||||
}
|
||||
// theme 出 JSON 对象(2026-10-09 契约);值已过 decodeThemeState 校验,解析失败按 null 降级
|
||||
out.put("theme", theme == null ? null : ThemeCodec.toJsonNode(theme));
|
||||
|
||||
Reference in New Issue
Block a user