用户重置密码加确认弹框
This commit is contained in:
@@ -25,10 +25,10 @@ export function isURL(s) {
|
||||
|
||||
/**
|
||||
* 密码
|
||||
* message: 密码长度至少8位,并包括数字、小写字母、大写字母和特殊符号4类中的3类
|
||||
* message: 密码长度至少8位,并包括数字、小写字母、大写字母和特殊符号4类
|
||||
*/
|
||||
export function passwordReg(s) {
|
||||
return /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,./]).{8,30}$/.test(s)
|
||||
return /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,./]).{8,30}$/.test(s)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -304,13 +304,21 @@ export default {
|
||||
* 重置密码
|
||||
* */
|
||||
resetPassword(record) {
|
||||
resetUserPassword({ username: record.username }).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
const that = this
|
||||
this.$confirm({
|
||||
title: '确认重置密码',
|
||||
content: '是否重置该用户密码',
|
||||
onOk: function () {
|
||||
resetUserPassword({ username: record.username }).then(res => {
|
||||
if (res.success) {
|
||||
that.$message.success(res.message)
|
||||
} else {
|
||||
that.$message.warning(res.message)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
/*
|
||||
* 启用禁用
|
||||
|
||||
@@ -574,7 +574,7 @@ export default {
|
||||
callback()
|
||||
}
|
||||
if (!passwordReg(value)) {
|
||||
callback('密码长度至少8位,并包括数字、小写字母、大写字母和特殊符号4类中的3类')
|
||||
callback('密码长度至少8位,并包括数字、小写字母、大写字母和特殊符号4类')
|
||||
}
|
||||
if (value && this.confirmDirty) {
|
||||
form.validateFields(['confirm'], {force: true})
|
||||
|
||||
Reference in New Issue
Block a user