|
@@ -83,6 +83,7 @@
|
|
|
class="qm-primary-button"
|
|
|
long
|
|
|
:disabled="disableLoginBtn"
|
|
|
+ :loading="loginBtnLoading"
|
|
|
@click="login"
|
|
|
>
|
|
|
登录
|
|
@@ -142,6 +143,7 @@ export default {
|
|
|
],
|
|
|
},
|
|
|
disableLoginBtn: true,
|
|
|
+ loginBtnLoading: false,
|
|
|
VUE_APP_GIT_REPO_VERSION: process.env.VUE_APP_GIT_REPO_VERSION,
|
|
|
};
|
|
|
},
|
|
@@ -289,6 +291,9 @@ export default {
|
|
|
this.disableLoginBtn = false;
|
|
|
}
|
|
|
},
|
|
|
+ beforeDestroy() {
|
|
|
+ clearTimeout(this.loginTimeout);
|
|
|
+ },
|
|
|
methods: {
|
|
|
...mapMutations(["updateUser", "updateTimeDifference"]),
|
|
|
async login() {
|
|
@@ -297,7 +302,11 @@ export default {
|
|
|
}
|
|
|
await this.checkNewVersion();
|
|
|
this.disableLoginBtn = true;
|
|
|
- setTimeout(() => (this.disableLoginBtn = false), 5000);
|
|
|
+ this.loginBtnLoading = true;
|
|
|
+ this.loginTimeout = setTimeout(() => {
|
|
|
+ this.disableLoginBtn = false;
|
|
|
+ this.loginBtnLoading = false;
|
|
|
+ }, 10 * 1000);
|
|
|
// https://www.cnblogs.com/weiqinl/p/6708993.html
|
|
|
const valid = await this.$refs.loginForm.validate();
|
|
|
if (valid) {
|