feat(config): /app/config 下发登录页背景地址
backend-ci / test (push) Canceled after 0s

This commit is contained in:
jianghaifeng authored and trae-solo-agent committed 2026-10-30 17:14:46 +08:00
1 parent f2103f6604
commit 958de5ef22
3 files changed
+4

No files matched your search

+1
View File
@@ -639,6 +639,7 @@ B1-2 的退款/拒付复验依赖它。服务端凭据(`packageName` + service
| `noticeEnabled` | `app.notice.enabled` | `true` | 公告入口开关 |
| `coinUnlockEnabled` | `app.coin.unlock.enabled` | `true` | 金币解锁开关 |
| `downloadEnabled` | `app.download.enabled` | `true` | 离线下载开关 |
| `loginBackgroundUrl` | `app.login.background.url` | `""` | 登录页全屏海报背景;留空 App 用内置默认图。**建议尺寸 1170×2532**(iPhone 14 Pro Max 3× 整屏竖图),后台走 `/admin/media/upload/` 任意 bizType 上传后把返回的相对路径(`/files/login_bg/xxx.jpg`)写入即可 |
**口径**:**只下发上述白名单键**(服务端硬编码白名单),后台配置里的其它键(可能含内部开关)
**一律不下发**;库里缺键时用「契约默认值」兜底,**不返回 null 让客户端自己猜默认值**。
@@ -35,6 +35,7 @@ public class AppConfigService {
KEYS.put("noticeEnabled", new KeySpec("app.notice.enabled", "true"));
KEYS.put("coinUnlockEnabled", new KeySpec("app.coin.unlock.enabled", "true"));
KEYS.put("downloadEnabled", new KeySpec("app.download.enabled", "true"));
KEYS.put("loginBackgroundUrl", new KeySpec("app.login.background.url", ""));
}
private final SysConfigMapper sysConfigMapper;
@@ -90,6 +90,7 @@ class AppCreatorAndConfigContractTest {
whitelist.put("noticeEnabled", true);
whitelist.put("coinUnlockEnabled", true);
whitelist.put("downloadEnabled", true);
whitelist.put("loginBackgroundUrl", "");
given(appConfigService.appConfig()).willReturn(whitelist);
String body = configMvc.perform(get("/app/config"))
@@ -97,6 +98,7 @@ class AppCreatorAndConfigContractTest {
.andExpect(jsonPath("$.code").value(0))
.andExpect(jsonPath("$.data.agreementVersion").value("2026-10-01"))
.andExpect(jsonPath("$.data.forceUpdate").value(false))
.andExpect(jsonPath("$.data.loginBackgroundUrl").value(""))
.andReturn().getResponse().getContentAsString(java.nio.charset.StandardCharsets.UTF_8);
// 没登录也能拿到(匿名)