新增评论通知功能:MCP工具 + REST端点 + 前端通知面板
- 新增 xhs_get_comment_notifications / xhs_reply_notification MCP工具 - 通知获取前先读取首页未读小红点数字,无未读则直接返回空,避免重复处理 - 新增 REST 端点 GET /notifications/comments 和 POST /notifications/reply - 前端小红书页面新增「通知」按钮和 NotificationPanel slide-over 组件 - 通知面板支持查看评论通知列表和行内回复
This commit is contained in:
@@ -8,6 +8,7 @@ import { FeedGrid } from '@/components/feed/FeedGrid';
|
||||
import { FeedDetail } from '@/components/feed/FeedDetail';
|
||||
import { UserCard } from '@/components/feed/UserCard';
|
||||
import { PublishModal } from '@/components/feed/PublishModal';
|
||||
import { NotificationPanel } from '@/components/feed/NotificationPanel';
|
||||
import { useAuth } from '@/context/AuthContext';
|
||||
import { useToast } from '@/context/ToastContext';
|
||||
import { useLoginStatus } from '@/hooks/useLoginStatus';
|
||||
@@ -136,6 +137,7 @@ export function XiaohongshuPage() {
|
||||
const [selectedFeed, setSelectedFeed] = useState<{ id: string; xsecToken: string } | null>(null);
|
||||
const [userView, setUserView] = useState<{ userId: string; xsecToken: string } | null>(null);
|
||||
const [publishOpen, setPublishOpen] = useState(false);
|
||||
const [notificationOpen, setNotificationOpen] = useState(false);
|
||||
|
||||
const loadFeed = useCallback(async () => {
|
||||
setFeedsLoading(true);
|
||||
@@ -231,6 +233,9 @@ export function XiaohongshuPage() {
|
||||
<Button size="sm" variant="secondary" onClick={() => setPublishOpen(true)}>
|
||||
发布
|
||||
</Button>
|
||||
<Button size="sm" variant="ghost" onClick={() => setNotificationOpen(true)}>
|
||||
通知
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -364,6 +369,9 @@ export function XiaohongshuPage() {
|
||||
{/* ── Publish modal ── */}
|
||||
{publishOpen && <PublishModal onClose={() => setPublishOpen(false)} />}
|
||||
|
||||
{/* ── Notification panel ── */}
|
||||
{notificationOpen && <NotificationPanel onClose={() => setNotificationOpen(false)} />}
|
||||
|
||||
{/* ── User profile slide-over ── */}
|
||||
{userView && (
|
||||
<div className="fixed inset-0 z-50 flex">
|
||||
|
||||
Reference in New Issue
Block a user