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,36 @@
"use client";
import { useState } from "react";
import { useRouter } from "next/navigation";
import { MessageSquare } from "lucide-react";
import { apiOpenDirectChat } from "@/lib/api";
import { toast } from "@/lib/toast";
/** 用户主页:发起私聊 */
export default function StartDMButton({ userId }: { userId: number }) {
const router = useRouter();
const [loading, setLoading] = useState(false);
const start = async () => {
setLoading(true);
try {
const { room } = await apiOpenDirectChat(userId);
router.push(`/chat/${room.id}`);
} catch (e) {
toast(e instanceof Error ? e.message : "无法发起私聊");
} finally {
setLoading(false);
}
};
return (
<button
onClick={start}
disabled={loading}
className="btn btn-accent btn-sm gap-1.5"
>
<MessageSquare size={14} />
{loading ? "打开中…" : "私聊"}
</button>
);
}