完善站点运营设置:分路由管理、登录可见评论、邮件模板内联与关闭注册 SSR。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -9,8 +9,8 @@ import {
|
||||
type AdminContentPost,
|
||||
type AdminContentStatus,
|
||||
} from "@/lib/api";
|
||||
import { getMeCached, getPublicSettingsCached } from "@/lib/serverData";
|
||||
import { canModerateAny, isSuperOrOwner, isOwner } from "@/lib/roles";
|
||||
import { getMeCached } from "@/lib/serverData";
|
||||
import { canModerateAny, isOwner } from "@/lib/roles";
|
||||
import Forbidden from "../Forbidden";
|
||||
import ContentAdmin, { type ContentKind } from "./ContentAdmin";
|
||||
|
||||
@@ -51,7 +51,7 @@ export default async function AdminContentPage({ searchParams }: ContentPageProp
|
||||
let initError = "";
|
||||
|
||||
// PC 双栏同时展示:SSR 并行预取帖子与评论
|
||||
const [postsSettled, commentsSettled, counts, settings] = await Promise.all([
|
||||
const [postsSettled, commentsSettled, counts] = await Promise.all([
|
||||
fetchAdminContentPosts(1, initialStatus, cookie || undefined)
|
||||
.then((res) => ({ ok: true as const, res }))
|
||||
.catch((e) => ({
|
||||
@@ -65,7 +65,6 @@ export default async function AdminContentPage({ searchParams }: ContentPageProp
|
||||
error: e instanceof Error ? e.message : "获取评论失败",
|
||||
})),
|
||||
fetchAdminContentCounts(cookie || undefined),
|
||||
getPublicSettingsCached(),
|
||||
]);
|
||||
|
||||
if (postsSettled.ok) {
|
||||
@@ -92,10 +91,8 @@ export default async function AdminContentPage({ searchParams }: ContentPageProp
|
||||
initialCommentsTotal={initialCommentsTotal}
|
||||
initialCounts={counts}
|
||||
initError={initError}
|
||||
canConfigureSettings={isSuperOrOwner(me.user.role)}
|
||||
canPurge={isOwner(me.user.role)}
|
||||
viewerRole={me.user.role}
|
||||
initialSettings={settings}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user