From 6f5a90ce5d859c56b56fb073ecf87ee171e3eeb2 Mon Sep 17 00:00:00 2001 From: MO <448233645@qq.com> Date: Thu, 21 Sep 2023 15:01:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=86=E7=A0=81=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/setting/passwords/index.vue | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/views/setting/passwords/index.vue b/src/views/setting/passwords/index.vue index 95809d4d..bdb6eae0 100644 --- a/src/views/setting/passwords/index.vue +++ b/src/views/setting/passwords/index.vue @@ -39,6 +39,17 @@ export default { }); }, submit() { + var pwdRegex = new RegExp("(?=.*[0-9])(?=.*[a-zA-Z])"); + if (this.passwords.length < 8 || this.passwords.length > 20) { + this.$modal.msgError("您的密码长度不符合!"); + return false; + } + if (!pwdRegex.test(this.passwords)) { + this.$modal.msgError( + "您的密码复杂度太低(密码中必须包含字母、数字),请及时修改密码!" + ); + return false; + } const data = this.passwords; createPasswords({ passwordValue: data }).then((response) => { this.$modal.msgSuccess("设置成功");