diff --git a/src/pages/system/administrator/compenents/create.tsx b/src/pages/system/administrator/compenents/create.tsx index 69ddf6b..d92845c 100644 --- a/src/pages/system/administrator/compenents/create.tsx +++ b/src/pages/system/administrator/compenents/create.tsx @@ -5,12 +5,14 @@ import { adminUser } from "../../../../api/index"; interface PropInterface { roleId: number; + refresh: boolean; open: boolean; onCancel: () => void; } export const SystemAdministratorCreate: React.FC = ({ roleId, + refresh, open, onCancel, }) => { @@ -20,7 +22,7 @@ export const SystemAdministratorCreate: React.FC = ({ useEffect(() => { getParams(); - }, []); + }, [refresh]); useEffect(() => { let roleIds = []; diff --git a/src/pages/system/administrator/compenents/update.tsx b/src/pages/system/administrator/compenents/update.tsx index ff6613a..ac92d16 100644 --- a/src/pages/system/administrator/compenents/update.tsx +++ b/src/pages/system/administrator/compenents/update.tsx @@ -5,12 +5,14 @@ import { adminUser } from "../../../../api/index"; interface PropInterface { id: number; + refresh: boolean; open: boolean; onCancel: () => void; } export const SystemAdministratorUpdate: React.FC = ({ id, + refresh, open, onCancel, }) => { @@ -20,7 +22,7 @@ export const SystemAdministratorUpdate: React.FC = ({ useEffect(() => { getParams(); - }, []); + }, [refresh]); useEffect(() => { if (id === 0) { diff --git a/src/pages/system/administrator/index.tsx b/src/pages/system/administrator/index.tsx index 4293adc..ab0c9c9 100644 --- a/src/pages/system/administrator/index.tsx +++ b/src/pages/system/administrator/index.tsx @@ -312,6 +312,7 @@ const SystemAdministratorPage = () => { rowKey={(record) => record.id} /> { @@ -321,6 +322,7 @@ const SystemAdministratorPage = () => { /> { setUpdateVisible(false);