1
This commit is contained in:
parent
de3d9568e9
commit
9f21cc1d02
|
|
@ -305,6 +305,11 @@ const AdminDashboard = () => {
|
|||
const timer = setInterval(loadData, 30000) // 30秒刷新一次
|
||||
return () => clearInterval(timer)
|
||||
}, [])
|
||||
useEffect(() => {
|
||||
const onUpdated = () => loadData()
|
||||
window.addEventListener('ats:accounts:updated', onUpdated)
|
||||
return () => window.removeEventListener('ats:accounts:updated', onUpdated)
|
||||
}, [])
|
||||
|
||||
if (loading && !data) return <div className="loading">加载中...</div>
|
||||
if (error) return <div className="error">加载失败: {error}</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user