diff --git a/src/api/system/user/index.ts b/src/api/system/user/index.ts index 911a5ad..a432171 100644 --- a/src/api/system/user/index.ts +++ b/src/api/system/user/index.ts @@ -111,6 +111,17 @@ export const changeUserStatus = (userId: number | string, status: string) => { }); }; +/** + * 解锁用户 + * @param userId 用户ID + */ +export const unlockUser = (userId: number | string) => { + return request({ + url: '/system/user/unlock/' + userId, + method: 'get', + }); +}; + /** * 查询用户个人信息 */ @@ -219,6 +230,7 @@ export default { delUser, resetUserPwd, changeUserStatus, + unlockUser, getUserProfile, updateUserProfile, updateUserPwd, diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index 04dd0aa..fa08670 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -89,6 +89,9 @@ 删除 + + 解锁 + 更多 @@ -511,6 +514,16 @@ const handleDelete = async (row?: UserVO) => { } }; +/** 解锁按钮操作 */ +const handleUnlock = async () => { + const userId = ids.value[0]; + const [err] = await to(proxy?.$modal.confirm('是否确认解锁用户编号为"' + userId + '"的数据项?') as any); + if (!err) { + await api.unlockUser(userId); + proxy?.$modal.msgSuccess('用户编号"' + userId + '"解锁成功'); + } +}; + /** 用户状态修改 */ const handleStatusChange = async (row: UserVO) => { const text = row.status === '0' ? '启用' : '停用';