diff --git a/src/utils/validate.js b/src/utils/validate.js index d9126a0..08d8370 100644 --- a/src/utils/validate.js +++ b/src/utils/validate.js @@ -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) } /** diff --git a/src/views/system/UserList.vue b/src/views/system/UserList.vue index 6164090..39aea45 100644 --- a/src/views/system/UserList.vue +++ b/src/views/system/UserList.vue @@ -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) + } + }) } }) + }, /* * 启用禁用 diff --git a/src/views/system/modules/UserModal.vue b/src/views/system/modules/UserModal.vue index e40b38b..c60fda6 100644 --- a/src/views/system/modules/UserModal.vue +++ b/src/views/system/modules/UserModal.vue @@ -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})