轮询修改,媒体过期判断
This commit is contained in:
@@ -389,15 +389,17 @@ const AppLayout: React.FC = () => {
|
||||
|
||||
{/* Floating sidebar toggle hover zone */}
|
||||
<div
|
||||
className="desktop-sidebar-toggle-zone"
|
||||
onMouseEnter={() => setToggleHover(true)}
|
||||
onMouseLeave={() => setToggleHover(false)}
|
||||
style={{
|
||||
position: 'fixed', left: sidebarW - 16, top: 0, bottom: 0,
|
||||
zIndex: 110, width: 32, cursor: 'default',
|
||||
transition: 'left 0.25s ease',
|
||||
}}
|
||||
>
|
||||
{toggleHover && (
|
||||
<div onClick={() => setCollapsed(!collapsed)} style={{
|
||||
<div onClick={() => setCollapsed(prev => !prev)} style={{
|
||||
position: 'absolute', left: '50%', top: '50%',
|
||||
transform: 'translate(-50%, -50%)',
|
||||
width: 24, height: 56, borderRadius: '0 8px 8px 0',
|
||||
|
||||
@@ -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 */ }
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user