From 2f41f71f20e09eb712e140fec2aca0c597d38809 Mon Sep 17 00:00:00 2001 From: "peng.peng" Date: Mon, 12 Jun 2023 16:40:23 +0800 Subject: [PATCH] =?UTF-8?q?(*)=E4=BF=AE=E6=94=B9=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/controllers/member/index.js | 4 ++- .../src/layout/components/header/index.js | 4 +-- .../memberManagement/containers/member.js | 26 ++++++++++++------- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/api/app/lib/controllers/member/index.js b/api/app/lib/controllers/member/index.js index 3791360..ed65497 100644 --- a/api/app/lib/controllers/member/index.js +++ b/api/app/lib/controllers/member/index.js @@ -10,7 +10,9 @@ function getUserList(opts) { const Op = ctx.fs.dc.ORM.Op; let errMsg = { message: '获取用户失败' } try { - let searchWhere = {} + let searchWhere = { + username: { $not: 'SuperAdmin' } + } let option = { where: searchWhere, order: [["id", "desc"]], diff --git a/web/client/src/layout/components/header/index.js b/web/client/src/layout/components/header/index.js index 0d1e428..076e3b9 100644 --- a/web/client/src/layout/components/header/index.js +++ b/web/client/src/layout/components/header/index.js @@ -71,8 +71,8 @@ const Header = props => { icon: , label: 重置密码} - title="重置密码" + triggerRender={修改密码} + title="修改密码" onFinish={onFinish} key="resetPassword" />, diff --git a/web/client/src/sections/memberManagement/containers/member.js b/web/client/src/sections/memberManagement/containers/member.js index fb64dba..6ea741b 100644 --- a/web/client/src/sections/memberManagement/containers/member.js +++ b/web/client/src/sections/memberManagement/containers/member.js @@ -8,7 +8,7 @@ import ResetPasswordModal from '../components/resetPassword'; import { useFsRequest, ApiTable } from '$utils'; import './style.less'; function Member(props) { - const { loading, clientHeight, actions, dispatch, member } = props; + const { loading, clientHeight, actions, dispatch, member, user } = props; const [pageSize, setPageSize] = useState(10); const [currentPage, setCurrentPage] = useState(1); const [searchValue, setSearchValue] = useState('') @@ -86,13 +86,21 @@ function Member(props) { > 删除 ) - options.push(重置密码} - title="重置密码" - onFinish={onFinish} - key="resetPassword" - />) + user?.username == 'SuperAdmin' && options.push( +
是否确认重置该用户密码?
+ } + onConfirm={() => { + dispatch(actions.memberManagement.modifyUser(record.id, { password: 'e10adc3949ba59abbe56e057f20f883e' }, '重置密码')) + }} + okText="是" + cancelText="否" + > + 重置密码 +
) + return options; @@ -173,7 +181,6 @@ function Member(props) { y: clientHeight - 260 } } - //1490 2256 pagination={{ size: 'large', total: member?.count, @@ -213,6 +220,7 @@ function mapStateToProps(state) { clientHeight: global.clientHeight, actions: global.actions, member: member?.data || {}, + user: auth.user }; }