轮询修改,媒体过期判断

This commit is contained in:
孙佳艺
2026-06-04 13:03:04 +08:00
parent 64f7069ae2
commit 450e509b1a
13 changed files with 1812 additions and 678 deletions
@@ -2,6 +2,7 @@ import React, { useEffect, useState, useCallback } from 'react';
import { Tag, Typography, Button } from 'antd';
import { BellOutlined, ThunderboltOutlined, GiftOutlined, StarOutlined, CloseOutlined } from '@ant-design/icons';
import { getNotifications, markNotificationRead } from '../api';
import { useAuthStore } from '../store/useAuthStore';
interface Notification {
id: string;
@@ -22,6 +23,7 @@ const NotificationPopup: React.FC = () => {
const [visible, setVisible] = useState(false);
const [notifications, setNotifications] = useState<Notification[]>([]);
const [currentIndex, setCurrentIndex] = useState(0);
const refreshUser = useAuthStore((state) => state.refreshUser);
const fetchNotifications = useCallback(async () => {
try {
@@ -52,6 +54,8 @@ const NotificationPopup: React.FC = () => {
setVisible(false);
setNotifications([]);
setCurrentIndex(0);
// 刷新用户信息(包括积分)
try { await refreshUser(); } catch { /* ignore */ }
}
};