From a583c319505800143b998ef84f9671a475ac1372 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A6=BA=E7=8B=A8?= <18119604035@163.com> Date: Tue, 4 Apr 2023 14:55:29 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E7=90=86=E4=BA=BA=E5=91=98=E8=A7=92?= =?UTF-8?q?=E8=89=B2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/system/administrator/compenents/create.tsx | 4 +++- src/pages/system/administrator/compenents/update.tsx | 4 +++- src/pages/system/administrator/index.tsx | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) 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);