feat: 排序标签强制刷新、推荐帖仅 featured,软刷新同步 limits/品牌文案

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-01 07:32:21 +08:00
parent 4ca5c17e2e
commit 21c6233fc0
9 changed files with 79 additions and 33 deletions

View File

@@ -80,9 +80,18 @@ export function useForumLimits() {
return { limits, loading };
}
/** 冷启动 / 预热:确保 limits 已写入模块缓存 */
export function ensureForumLimitsLoaded(): Promise<ForumLimitsPublic> {
return fetchLimits();
/** 冷启动 / 预热:确保 limits 已写入模块缓存;force 时重拉并在成功后通知 hook */
export async function ensureForumLimitsLoaded(opts?: { force?: boolean }): Promise<ForumLimitsPublic> {
if (opts?.force) {
cached = null;
inflight = null;
}
const limits = await fetchLimits();
if (opts?.force) {
cacheEpoch += 1;
listeners.forEach(fn => fn());
}
return limits;
}
/** 文档 SSR / 管理端:同步写入 limits 模块缓存 */