dedsudiyu 2 年之前
父節點
當前提交
9b139e945d
共有 1 個文件被更改,包括 6 次插入2 次删除
  1. 6 2
      src/views/loginOne.vue

+ 6 - 2
src/views/loginOne.vue

@@ -127,7 +127,7 @@
         //手机号验证
         checkPhone(value) {
           if (!value) {
-            this.text = '*请输入手机号码';
+            this.text = '*手机号不能为空哦~';
             return false
           } else {
             const reg = /^1[3|4|5|7|8|9][0-9]\d{8}$/;
@@ -144,7 +144,11 @@
         //登录
         handleLogin(){
           let self = this;
-          if(this.checkPhone(this.loginForm.username)&&this.loginForm.password){
+          if(this.checkPhone(this.loginForm.username)){
+            if(!this.loginForm.password){
+              this.text = '*请输入正确的验证码';
+              return
+            }
             this.text = "";
             this.$refs.loginForm.validate(valid => {
               if (valid) {