소스 검색

登录button添加loading属性,校验失败属性变为false

ZhangWenQiang 6 년 전
부모
커밋
e633ebd4ab
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. 5 2
      src/views/user/Login.vue

+ 5 - 2
src/views/user/Login.vue

@@ -215,7 +215,7 @@
         let loginParams = {
           remember_me: that.formLogin.rememberMe
         }
-        that.loading = true
+        that.loading = true;
         // 使用账户密码登陆
         if (that.customActiveKey === 'tab1') {
           that.form.validateFields(['username', 'password', 'inputCode'], { force: true }, (err, values) => {
@@ -228,7 +228,10 @@
               }).catch((err) => {
                 that.requestFailed(err)
               })
-
+            }else{
+              setTimeout(function() {
+                that.loading = false;
+              },1000)
             }
           })
           // 使用手机号登陆