feat: 后台增加开放消息开关

关闭后前台隐藏私聊/群聊入口并由后端拦截;同步去掉公告页重复计数胶囊。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-17 04:16:10 +08:00
parent 9a55c2f6f2
commit 4b93739468
18 changed files with 275 additions and 91 deletions

View File

@@ -2,9 +2,10 @@ import { redirect } from "next/navigation";
import { cookies } from "next/headers";
import type { Metadata } from "next";
import { authCookieHeader } from "@/lib/cookies";
import { getMeCached } from "@/lib/serverData";
import { getMeCached, getPublicSettingsCached } from "@/lib/serverData";
import { fetchChatRooms } from "@/lib/api";
import ChatShell from "./ChatShell";
import MessagesUnsupported from "@/components/MessagesUnsupported";
export const metadata: Metadata = {
title: "消息",
@@ -12,6 +13,9 @@ export const metadata: Metadata = {
};
export default async function ChatListPage() {
if ((await getPublicSettingsCached()).allow_messages === false) {
return <MessagesUnsupported />;
}
const cookie = authCookieHeader(await cookies());
const me = await getMeCached(cookie || undefined);
if (!me.user) {