diff --git a/src/pages/system/org/user/UserList.tsx b/src/pages/system/org/user/UserList.tsx index d4a0f8c3e..1aa5e3a1d 100644 --- a/src/pages/system/org/user/UserList.tsx +++ b/src/pages/system/org/user/UserList.tsx @@ -97,6 +97,7 @@ const UserList: React.FC = props => { }); if (index === selectRow.length - 1) { message.success('操作成功!'); + props.close(); setLoading(false); } }); diff --git a/src/pages/system/role/user/UserList.tsx b/src/pages/system/role/user/UserList.tsx index 882fb40ef..11bc51ff9 100644 --- a/src/pages/system/role/user/UserList.tsx +++ b/src/pages/system/role/user/UserList.tsx @@ -64,9 +64,12 @@ const UserList: React.FC = props => { }, []); // { "dimensionTypeId": "org", "dimensionId": "org1", "dimensionName": "机构1", "userId": "1209763126217355264", "userName": "antd" } - const bindUser = () => { + + const bindUser = async () => { + setLoading(true); - selectRow.forEach((item, index) => { + + await selectRow.forEach((item, index) => { apis.org .bind({ userId: item.id, @@ -83,11 +86,11 @@ const UserList: React.FC = props => { }) .catch(() => { message.success('绑定失败!'); - setLoading(false); }); if (index === selectRow.length - 1) { message.success('操作成功!'); setLoading(false); + props.close() } }); };