diff --git a/frontend/src/components/GlobalConfig.jsx b/frontend/src/components/GlobalConfig.jsx index fd1d95b..ea258d6 100644 --- a/frontend/src/components/GlobalConfig.jsx +++ b/frontend/src/components/GlobalConfig.jsx @@ -891,31 +891,7 @@ const GlobalConfig = () => { } - const loadUsersAndAccounts = async () => { - if (!isAdmin) return - try { - setBusy(true) - const [users, accounts] = await Promise.all([ - api.getUsersDetailed ? api.getUsersDetailed() : api.get('/admin/users/detailed').then(r => r.data), - api.getAccounts(), - ]) - setUsersDetailed(Array.isArray(users) ? users : []) - setAccountsAdmin(Array.isArray(accounts) ? accounts : []) - const initMap = {} - ;(Array.isArray(users) ? users : []).forEach(u => { - initMap[u.id] = '' - }) - setLinkAccountMap(initMap) - } catch (e) { - setMessage(e?.message || '加载失败') - } finally { - setBusy(false) - } - } - - useEffect(() => { - if (isAdmin) loadUsersAndAccounts() - }, [isAdmin]) + if (loading) { return