feat: 实时消息与管理端运营能力

新增群聊/私信与公共 WebSocket 总线,站长用户内容档案,并将通知与待审角标改为推送驱动;同步精简管理仪表盘并修复主题换肤 DOM 冲突。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-15 22:58:16 +08:00
parent 29db9ae9b5
commit 42c395a864
55 changed files with 7607 additions and 346 deletions

View File

@@ -0,0 +1,34 @@
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 { fetchChatRooms } from "@/lib/api";
import ChatShell from "./ChatShell";
export const metadata: Metadata = {
title: "消息",
description: "私聊与群聊,实时交流。",
};
export default async function ChatListPage() {
const cookie = authCookieHeader(await cookies());
const me = await getMeCached(cookie || undefined);
if (!me.user) {
redirect(`/login?redirect=${encodeURIComponent("/chat")}`);
}
let rooms: Awaited<ReturnType<typeof fetchChatRooms>>["rooms"] = [];
try {
const data = await fetchChatRooms(1, 50, "", cookie, "joined");
rooms = data.rooms || [];
} catch {
rooms = [];
}
return (
<div className="max-w-6xl mx-auto">
<ChatShell meId={me.user.id} initialRooms={rooms} activeRoomId={null} />
</div>
);
}