浏览代码

修改休眠

zhaoke 3 年之前
父节点
当前提交
e99cb8ba60
共有 1 个文件被更改,包括 16 次插入10 次删除
  1. 16 10
      src/App.vue

+ 16 - 10
src/App.vue

@@ -170,25 +170,31 @@ export default {
           ? JSON.parse(this.systemSet)
           : this.systemSet;
       const { LockMins } = obj;
-      this.time = LockMins * 60;
-      this.desc = LockMins * 60;
+      this.time = LockMins * 10;
+      this.desc = LockMins * 10;
       this.timer = setInterval(() => {
         this.time--;
         if (this.time === 0) {
           const result = this.arrLen;
           const rut = this.arr;
           result.push(rut.length);
-          if (result.length >= 2) {
-            if (result[result.length - 2] === result[result.length - 1]) {
-              // 相同时 结束倒计时
-              this.$store.dispatch("app/toggleDialog", true);
-              this.getCheckCode();
-              this.clearAll();
+          if (rut.length == 0) {
+            this.$store.dispatch("app/toggleDialog", true);
+            this.getCheckCode();
+            this.clearAll();
+          } else {
+            if (result.length >= 2) {
+              if (result[result.length - 2] === result[result.length - 1]) {
+                // 相同时 结束倒计时
+                this.$store.dispatch("app/toggleDialog", true);
+                this.getCheckCode();
+                this.clearAll();
+              } else {
+                this.time = this.desc;
+              }
             } else {
               this.time = this.desc;
             }
-          } else {
-            this.time = this.desc;
           }
         }
       }, 1000);