From 11c42c48f808176f32ee218584b1b537cf1b660e Mon Sep 17 00:00:00 2001 From: LiuJiaNan <15703339975@163.com> Date: Thu, 20 Aug 2026 17:47:26 +0800 Subject: [PATCH] =?UTF-8?q?feat(user):=20=E4=BC=98=E5=8C=96=E9=87=8D?= =?UTF-8?q?=E7=BD=AE=E5=AF=86=E7=A0=81=E6=B5=81=E7=A8=8B=EF=BC=8C=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=8A=A8=E6=80=81=E9=BB=98=E8=AE=A4=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在用户相关接口中新增获取默认密码的请求方法 - 多个用户管理页面引入重置密码状态,支持按钮加载态显示 - 重构重置密码函数,先异步调用获取默认密码接口 - 弹窗提示显示动态获取的默认密码,增强用户确认体验 - 成功重置密码后刷新数据,保持界面最新状态 - 更新命名空间依赖,新增NS_USER支持对应请求与数据绑定 --- src/api/user/index.js | 4 +++ .../AccountManage/List/index.js | 35 +++++++++++-------- .../StakeholderUnit/User/UserList/index.js | 31 +++++++++------- .../Container/Enterprise/User/List/index.js | 31 +++++++++------- .../Container/Stakeholder/User/List/index.js | 31 +++++++++------- .../BranchCompany/AccountManage/List/index.js | 35 +++++++++++-------- .../AccountManage/List/index.js | 35 +++++++++++-------- .../StakeholderUnit/User/UserList/index.js | 31 +++++++++------- .../Supervision/User/List/index.js | 31 +++++++++------- 9 files changed, 162 insertions(+), 102 deletions(-) diff --git a/src/api/user/index.js b/src/api/user/index.js index 935a6be..e210379 100644 --- a/src/api/user/index.js +++ b/src/api/user/index.js @@ -66,6 +66,10 @@ export const userChangePassword = declareRequest( "userLoading", "Post > @/basicInfo/user/changePassword/{id}", ); +export const userGetDefaultPwd = declareRequest( + "userLoading", + "Post > @/basicInfo/user/getDefaultPwd", +); // 校验用户名 手机号 身份证号是否重复 export const verifyUser = declareRequest( diff --git a/src/pages/Container/Enterprise/StakeholderUnit/AccountManage/List/index.js b/src/pages/Container/Enterprise/StakeholderUnit/AccountManage/List/index.js index 094cf81..563e0bc 100644 --- a/src/pages/Container/Enterprise/StakeholderUnit/AccountManage/List/index.js +++ b/src/pages/Container/Enterprise/StakeholderUnit/AccountManage/List/index.js @@ -13,7 +13,7 @@ import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; import useTable from "zy-react-library/hooks/useTable"; import { UNIFIED_SOCIAL_CREDIT_CODE } from "zy-react-library/regular"; import { getLabelName } from "zy-react-library/utils"; -import { NS_ENTERPRISE, NS_GLOBAL } from "~/enumerate/namespace"; +import { NS_ENTERPRISE, NS_GLOBAL, NS_USER } from "~/enumerate/namespace"; import { getMenuIdByPath, getTenantTypeConfigList, useDebounce } from "~/utils"; function List(props) { @@ -42,27 +42,33 @@ function List(props) { }); const [addModalOpen, setAddModalOpen] = useState(false); const [currentId, setCurrentId] = useState(""); + const [resetPasswordId, setResetPasswordId] = useState(""); useEffect(() => { getMenuIdByPath().then(setMenuId); }, []); useEffect(() => { getTenantTypeConfigList({ request: props.tenantTypeConfigList }).then(setTenantTypeConfigList); }, []); - const onResetPassword = (id) => { - Modal.confirm({ - title: "提示", - content: "是否重置密码为Cc@12345678?", - onOk: () => { - props["corpInfoChangePassword"]({ - id, - }).then((res) => { - if (res.success) { + const onResetPassword = async (id) => { + setResetPasswordId(id); + try { + const res = await props["userGetDefaultPwd"]({ corpinfoId: id }); + if (!res.success) + return; + Modal.confirm({ + title: "提示", + content: `确定要重置密码为${res.data}吗?`, + onOk: () => props["corpInfoChangePassword"]({ id }).then((resetRes) => { + if (resetRes.success) { message.success("重置密码成功"); getData(); } - }); - }, - }); + }), + }); + } + finally { + setResetPasswordId(""); + } }; const onDelete = (id) => { @@ -254,6 +260,7 @@ function List(props) { && (