zhongtianhaoyuan 2 роки тому
батько
коміт
3639ebeffb
1 змінених файлів з 14 додано та 10 видалено
  1. 14 10
      src/views/login/index.vue

+ 14 - 10
src/views/login/index.vue

@@ -130,12 +130,12 @@
           username: [{
           username: [{
               required: true,
               required: true,
               trigger: "blur",
               trigger: "blur",
-              message: "请输入用户名",
+              message: "请输入账号",
             },
             },
             {
             {
-              min: 1,
-              max: 200,
-              message: "长度在1-200字符之间",
+              min: 11,
+              max: 11,
+              message: "请输入11位手机号",
               trigger: "blur",
               trigger: "blur",
             },
             },
             {
             {
@@ -204,12 +204,16 @@
     },
     },
     methods: {
     methods: {
       nextLogin() { //校验验证码
       nextLogin() { //校验验证码
-        getCheckInfo({
-          phone: this.loginForm.username,
-          verifyCode: this.loginForm.checkCode
-        }).then(response => {
-          if (response.code == 200) { //验证码校验成功   登录
-            this.handleLogin()
+        this.$refs.loginForm.validate(async (valid) => {
+          if (valid) {
+            getCheckInfo({
+              phone: this.loginForm.username,
+              verifyCode: this.loginForm.checkCode
+            }).then(response => {
+              if (response.code == 200) { //验证码校验成功   登录
+                this.handleLogin()
+              }
+            })
           }
           }
         })
         })
       },
       },