diff --git a/frontend/src/pages/UsersPage.tsx b/frontend/src/pages/UsersPage.tsx index e00330e..13cc73e 100644 --- a/frontend/src/pages/UsersPage.tsx +++ b/frontend/src/pages/UsersPage.tsx @@ -960,7 +960,7 @@ function BatchImportModal({ onClose, onImported }: { onClose: () => void; onImpo setLdapLoading(true); try { const res = await ldapApi.listOus() as any; - setLdapOus(res?.ous || []); + setLdapOus(Array.isArray(res) ? res : (res?.ous || res?.data || [])); } catch { toast('error', '加载 LDAP OU 失败'); } finally { setLdapLoading(false); } }; @@ -969,7 +969,7 @@ function BatchImportModal({ onClose, onImported }: { onClose: () => void; onImpo setLdapLoading(true); try { const res = await ldapApi.listUsers({ base_dn: baseDn }) as any; - setLdapUsers(res?.users || []); + setLdapUsers(Array.isArray(res) ? res : (res?.users || res?.data || [])); } catch { toast('error', '加载 LDAP 用户失败'); } finally { setLdapLoading(false); } }; @@ -1201,9 +1201,9 @@ function BatchImportModal({ onClose, onImported }: { onClose: () => void; onImpo {ldapUsers.map(u => ( ))}