From ed15b9780dc9a944f20c8fe1f61e9b29a15b63b6 Mon Sep 17 00:00:00 2001 From: fengachen <373943794@qq.com> Date: Wed, 29 Sep 2021 09:42:07 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E9=87=8D=E7=BD=AE=E5=AF=86?= =?UTF-8?q?=E7=A0=81=E5=8A=A0=E7=A1=AE=E8=AE=A4=E5=BC=B9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/validate.js | 4 ++-- src/views/system/UserList.vue | 18 +++++++++++++----- src/views/system/modules/UserModal.vue | 2 +- 3 files changed, 16 insertions(+), 8 deletions(-) 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})