- 新增收藏功能:favorite 服务与 handler、FavoriteButton 组件 - 新增关注功能:follow 服务与 handler、FollowButton 组件 - 用户主页适配关注/粉丝与收藏展示 - flash 消息工具、广告与侧边栏组件微调
16 lines
815 B
TypeScript
16 lines
815 B
TypeScript
import { cache } from "react";
|
||
import { fetchBoards, fetchMe, fetchPublicSettings, fetchSiteState } from "./api";
|
||
|
||
// 同一 SSR 请求内去重:layout 与页面可能同时需要当前用户,
|
||
// 相同 Cookie 头参数下只产生一次 /api/me 调用。
|
||
export const getMeCached = cache((cookieHeader?: string) => fetchMe(cookieHeader));
|
||
|
||
// 同请求内去重:layout 注入主题 CSS 变量、后台页读取当前配置共用
|
||
export const getPublicSettingsCached = cache(() => fetchPublicSettings());
|
||
|
||
// 同请求内去重:注册/找回密码页读取开放状态与提示文案
|
||
export const getSiteStateCached = cache(() => fetchSiteState());
|
||
|
||
// 同请求内去重:帖子详情/用户主页渲染板块管理员徽章需板块名与配色
|
||
export const getBoardsCached = cache(() => fetchBoards());
|