重置密码修改

This commit is contained in:
lyd
2022-11-21 09:14:32 +08:00
parent 02bc9d15c3
commit 7c2a11eaab

View File

@@ -516,26 +516,10 @@ export default {
return row.id !== this.user.id
},
resetPassword(row) {
row.password = null
this.$prompt('', '重置密码', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputPlaceholder: '请输入新的密码',
inputPattern: /^[A-Z|a-z|0-9|(._~!@#$^&*)]{6,20}$/,
inputErrorMessage: '密码格式不正确,只能是6-20位密码',
closeOnClickModal: false
}).then(({ value }) => {
row.password = value
crudUser.edit(row).then(res => {
console.log(res)
this.crud.toQuery()
this.crud.notify('密码重置成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
})
}).catch(() => {
this.$message({
type: 'info',
message: '取消输入'
})
row.password = '123456'
crudUser.edit(row).then(res => {
this.crud.toQuery()
this.crud.notify('密码重置成功,密码:123456', CRUD.NOTIFICATION_TYPE.SUCCESS)
})
}
}