diff --git a/docs/api-contract.md b/docs/api-contract.md
index 23e5210..9bda624 100644
--- a/docs/api-contract.md
+++ b/docs/api-contract.md
@@ -95,7 +95,8 @@
"logoUrl": "",
"columns": 0,
"searchNewTab": true,
- "linkStyle": "classic"
+ "linkStyle": "classic",
+ "showUrl": true
}
}
```
@@ -106,6 +107,8 @@
`linkStyle`:首页链接样式,`classic`(默认)| `compact` | `wide`。存量库无此键(或存量值不在枚举内)时按 `classic` 返回。
+`showUrl`:首页链接卡是否显示网址,默认 `true`(保持改动前的呈现)。存量库无此键时按 `true` 返回。
+
### GET /api/wallpaper/today
同源代理 Bing 每日壁纸(无鉴权,公共页未登录也要取图)。
@@ -218,13 +221,15 @@ Passkey(WebAuthn,/api/auth/passkey/*,@simplewebauthn/server v14):
### 站点设置
-- `GET /api/admin/settings` → `{siteTitle, backgroundUrl, wallpaperSource, logoUrl, columns, searchNewTab, linkStyle}`
-- `PUT /api/admin/settings` body 可含 `{siteTitle, backgroundUrl, wallpaperSource(bing|custom), logoUrl, columns(0–12), searchNewTab(boolean), linkStyle(classic|compact|wide)}` → 更新后对象
+- `GET /api/admin/settings` → `{siteTitle, backgroundUrl, wallpaperSource, logoUrl, columns, searchNewTab, linkStyle, showUrl}`
+- `PUT /api/admin/settings` body 可含 `{siteTitle, backgroundUrl, wallpaperSource(bing|custom), logoUrl, columns(0–12), searchNewTab(boolean), linkStyle(classic|compact|wide), showUrl(boolean)}` → 更新后对象
主题(设深色/浅色)**不在**站点设置里:深浅色只由访客本机偏好(顶栏主题按钮,`localStorage` 键 `nav.visitor-theme`)决定,没有偏好时跟随系统外观。`PUT` 传 `theme` 不生效(白名单外的键一律忽略);存量的 `settings.theme` 行不删不迁移,只是停产不用。
`searchNewTab`:搜索是否在新标签页打开。存储键 `search_new_tab`,值 `"1"`/`"0"`(同 `totp_enabled` 的 KV 布尔惯例);库中**无此键**(存量库)时按 `true` 返回。写入只接受布尔值,非布尔返回 400 `searchNewTab must be a boolean`。
+`showUrl`:首页链接卡是否显示网址。存储键 `show_url`,值 `"1"`/`"0"`(同 `searchNewTab` 的 KV 布尔惯例);库中**无此键**(存量库)时按 `true` 返回。写入只接受布尔值,非布尔返回 400 `showUrl must be a boolean`,且一次被拒的请求不会写入同包的任何设置键。关闭后只影响普通模式的首页链接卡(`classic`/`wide` 两档不渲染网址行),首页编辑模式恒显示网址。
+
`wallpaperSource`:首页壁纸来源。存储键 `wallpaper_source`,值 `"bing"`/`"custom"`;库中**无此键**(存量库)时按 `bing` 返回。写入只接受 `bing`/`custom`,其他值返回 400 `wallpaperSource must be 'bing' or 'custom'`。
`linkStyle`:首页链接样式。存储键 `link_style`,值 `"classic"`/`"compact"`/`"wide"`;库中**无此键**(存量库)时按 `classic` 返回,存量脏值同样归一为 `classic`(不改写库行)。写入只接受这三个字符串值(非字符串一律拒绝),其他值返回 400 `linkStyle must be 'classic', 'compact' or 'wide'`,且一次被拒的请求不会写入同包的任何设置键。
diff --git a/web/src/components/admin/settings-panels.tsx b/web/src/components/admin/settings-panels.tsx
index e00a48e..11046c4 100644
--- a/web/src/components/admin/settings-panels.tsx
+++ b/web/src/components/admin/settings-panels.tsx
@@ -50,6 +50,7 @@ import {
LINK_STYLE_OPTIONS,
resolveLinkStyle,
} from "@/lib/link-style";
+import { resolveShowUrl } from "@/lib/show-url";
import { useNavStore } from "@/lib/nav-store";
import type {
AdminCategory,
@@ -265,6 +266,8 @@ export function SettingsPanel({
searchNewTab: settings.searchNewTab ?? true,
// 后端该键未落地 / 旧缓存时同样缺字段:契约缺省 classic(读侧统一兜底)
linkStyle: resolveLinkStyle(settings),
+ // 缺字段时按默认开:首页照旧显示网址(与 linkStyle 同一套读侧兜底)
+ showUrl: resolveShowUrl(settings),
});
const save = async () => {
@@ -384,6 +387,14 @@ export function SettingsPanel({
}
/>
+
+
+ setForm({ ...form, showUrl })}
+ />
+