feat: 后台增加开放消息开关
关闭后前台隐藏私聊/群聊入口并由后端拦截;同步去掉公告页重复计数胶囊。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -5,12 +5,16 @@ import { useRouter } from "next/navigation";
|
||||
import { MessageSquare } from "lucide-react";
|
||||
import { apiOpenDirectChat } from "@/lib/api";
|
||||
import { toast } from "@/lib/toast";
|
||||
import { useAllowMessages } from "@/components/MessagesPolicyProvider";
|
||||
|
||||
/** 用户主页:发起私聊 */
|
||||
export default function StartDMButton({ userId }: { userId: number }) {
|
||||
const router = useRouter();
|
||||
const allowMessages = useAllowMessages();
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
if (!allowMessages) return null;
|
||||
|
||||
const start = async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user