董国庆
2025-02-28 527a5a33364bf4d73dda8ed71e2c85894d5d324a
management/src/components/RightContent/AvatarDropdown.tsx
@@ -25,19 +25,20 @@
  const [unreadCount, setUnreadCount] = useState(0);
  useEffect(() => {
    // const timer = setInterval(() => {
    //   getUnreadCount().then((res: any) => {
    //     setUnreadCount(res.data || 0);
    //   });
    // }, 1000 * 5)
    const timer = setInterval(() => {
      getUnreadCount().then((res: any) => {
        setUnreadCount(res.data || 0);
      });
    }, 1000 * 5)
    // return () => clearInterval(timer);
    return () => clearInterval(timer);
  }, []);
  const onMenuClick = async () => {
    await outLogin();
    localStorage.clear();
    history.push('/login');
    flushSync(() => {
      setInitialState((s) => ({ ...s, currentUser: undefined }));
    });