diff --git a/src/views/home/login_v2.vue b/src/views/home/login_v2.vue index 959a8d74..9f6f713c 100644 --- a/src/views/home/login_v2.vue +++ b/src/views/home/login_v2.vue @@ -152,6 +152,7 @@ :disabled="pass" class="logo_btn" @click="loginFn" + :loading="isLoadingBtn" >{{ $t("message.login.login") }} @@ -422,6 +423,7 @@ export default { components: { getcode, LoginInfo }, data() { return { + isLoadingBtn: false, isShowContent: false, addPasswordDialog: false, passwordForm: { @@ -817,6 +819,7 @@ export default { this.$refs["LoginInfo"].$refs["form"].validate((valid) => { // console.log("this.$refs['LoginInfo']:", this.$refs["LoginInfo"]); if (valid) { + this.isLoadingBtn = true; if (LOGINTYPE == 1) { loginApi(this.form).then((res) => { console.log("--------------------么么儿们10"); @@ -837,6 +840,8 @@ export default { } this.parseLoginData(res.result); this.getDetail(this.headquartersSnData); + }).finally(() => { + this.isLoadingBtn = false; }); } else if (LOGINTYPE == 2) { console.log(2222222222222); @@ -856,9 +861,12 @@ export default { } this.parseLoginData(res.result); this.getDetail(this.headquartersSnData); + }).finally(() => { + this.isLoadingBtn = false; }); } else if (LOGINTYPE == 5) { console.log("中建四局项目账号"); + this.isLoadingBtn = false; } else if (LOGINTYPE == 3) { console.log(333333333); @@ -878,6 +886,8 @@ export default { } this.parseLoginData(res.result); this.getDetail(this.headquartersSnData); + }).finally(() => { + this.isLoadingBtn = false; }); } } else { @@ -888,6 +898,7 @@ export default { } else if (this.projectType == "common") { this.$refs["form"].validate((valid) => { if (valid) { + this.isLoadingBtn = true; if (LOGINTYPE == 1) { let timestamp = Date.now(); let md5Password = MD5( @@ -922,6 +933,8 @@ export default { this.parseLoginData(res.result); this.getDetail(this.headquartersSnData); } + }).finally(() => { + this.isLoadingBtn = false; }); } else if (LOGINTYPE == 2) { console.log(2222222222222); @@ -942,6 +955,8 @@ export default { } this.parseLoginData(res.result); this.getDetail(this.headquartersSnData); + }).finally(() => { + this.isLoadingBtn = false; }); } else if (LOGINTYPE == 3) { console.log(333333333); @@ -962,6 +977,8 @@ export default { } this.parseLoginData(res.result); this.getDetail(this.headquartersSnData); + }).finally(() => { + this.isLoadingBtn = false; }); } } else { @@ -974,6 +991,7 @@ export default { } else { this.$refs["form2"].validate((valid) => { if (valid) { + this.isLoadingBtn = true; loginPhoneApi(this.form2).then((res) => { // 前端判断登录账号与选中的登录方式(用户登录、供应商登录)不一致 if (this.loginType == 1 && res.result.accountType == 11) { @@ -985,6 +1003,8 @@ export default { return; } this.parseLoginData(res.result); + }).finally(() => { + this.isLoadingBtn = false; }); } else { console.log("error submit!!");