浏览代码

防止重复登录

Michael Wang 6 年之前
父节点
当前提交
d691cfa11b
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      src/features/Login/Login.vue

+ 2 - 0
src/features/Login/Login.vue

@@ -157,6 +157,8 @@ export default {
       if (this.disableLoginBtn) {
         return;
       }
+      this.disableLoginBtn = true;
+      setTimeout(() => (this.disableLoginBtn = false), 5000);
       const valid = await this.$refs[name].validate();
       if (valid) {
         console.log("form validated. start login...");