From 89e501c3c7230f1dc24b8ab404bf2dce55dee795 Mon Sep 17 00:00:00 2001 From: Zheng Jie <201507802@qq.com> Date: Thu, 6 Jul 2023 14:22:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=87=8D=E7=BD=AE=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=AF=86=E7=A0=81=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- eladmin-web/src/api/system/user.js | 10 ++++++- eladmin-web/src/views/system/user/index.vue | 31 ++++++++++++++++++++- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/eladmin-web/src/api/system/user.js b/eladmin-web/src/api/system/user.js index 6cd91a5..fee2d84 100644 --- a/eladmin-web/src/api/system/user.js +++ b/eladmin-web/src/api/system/user.js @@ -17,6 +17,14 @@ export function del(ids) { }) } +export function resetPwd(ids) { + return request({ + url: 'api/users/resetPwd', + method: 'put', + data: ids + }) +} + export function edit(data) { return request({ url: 'api/users', @@ -57,5 +65,5 @@ export function updateEmail(form) { }) } -export default { add, edit, del } +export default { add, edit, del, resetPwd } diff --git a/eladmin-web/src/views/system/user/index.vue b/eladmin-web/src/views/system/user/index.vue index 9017069..f64ba19 100644 --- a/eladmin-web/src/views/system/user/index.vue +++ b/eladmin-web/src/views/system/user/index.vue @@ -57,7 +57,19 @@ - + + 重置密码 + + @@ -471,6 +483,23 @@ export default { }, checkboxT(row, rowIndex) { return row.id !== this.user.id + }, + resetPwd(datas) { + this.$confirm(`你选中了 ${datas.length} 位用户,确认重置用户的密码吗?`, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + const ids = [] + datas.forEach(val => { + ids.push(val.id) + }) + console.log(ids) + crudUser.resetPwd(ids).then(() => { + this.crud.notify('重置成功, 用户新密码:123456', CRUD.NOTIFICATION_TYPE.SUCCESS) + }).catch(() => {}) + }).catch(() => { + }) } } }