Explorar el Código

修改忘记密码强制限制bug

秦鹏 hace 3 años
padre
commit
21069cf673
Se han modificado 1 ficheros con 22 adiciones y 2 borrados
  1. 22 2
      src/components/login/ForgetPassword.vue

+ 22 - 2
src/components/login/ForgetPassword.vue

@@ -291,7 +291,7 @@ export default {
     // 验证密码
     changeParssword() {
       if (this.password) {
-        let reg = /^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,12}$/;
+        let reg = /^(?=.*[0-9].*)(?=.*[A-Z].*)(?=.*[a-z].*).{8,12}$/;
         let result = reg.test(this.password);
         if (result) {
           this.passwordError = false;
@@ -314,10 +314,30 @@ export default {
 
     // 注册
     gotoLogin() {
+      if (this.phone_or_email == "") {
+        this.$message.warning("请输入邮箱。");
+        return;
+      }
+      if (this.password == "") {
+        this.$message.warning("请输入密码。");
+        return;
+      }
+      if (this.verification_code == "") {
+        this.$message.warning("请输入验证码。");
+        return;
+      }
+      if (this.passwordError) {
+        this.$message.warning("请重新输入密码。密码格式不对");
+        return;
+      }
+      if (this.twopassword != this.password) {
+        this.$message.warning("请输入确认密码。两个条目必须相同");
+        return;
+      }
       this.isLogin = true;
       let MethodName = "user_manager-ResetPassword";
       let data = {
-        user_type: this.ForgetType.toUpperCase(),
+        user_type: this.TorS.toUpperCase(),
         password: this.password,
         verification_type: this.loginType == "邮箱" ? "EMAIL" : "SMS",
         phone_or_email: this.phone_or_email,