From fa44bcc2861fe56e8af50fbd8f56065250a2ece3 Mon Sep 17 00:00:00 2001
From: ZZJ <zzjdsg2300@163.com>
Date: 星期四, 06 一月 2022 10:08:07 +0800
Subject: [PATCH] 报错处理

---
 src/pages/index/App.vue |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/pages/index/App.vue b/src/pages/index/App.vue
index f998f5e..892268e 100644
--- a/src/pages/index/App.vue
+++ b/src/pages/index/App.vue
@@ -28,7 +28,7 @@
       </el-carousel>
 
       <div class="control">
-        <div class="pre" @click="preForm">涓婁竴姝�</div>
+        <div class="pre" @click="preForm" v-if="active != 0">涓婁竴姝�</div>
         <div class="next" @click="nextForm" v-if="active == 0">涓嬩竴姝�</div>
         <div class="next" @click="nextFormNot" v-if="active == 1">璺宠繃</div>
         <div class="next" @click="nextForm" v-if="active == 1 && !isNet">
@@ -139,9 +139,13 @@
       this.$refs["carousel"].next();
     },
     async getInitInfo() {
-      const res = await getInitInfo();
+      const res = await getInitInfo().catch((err) => {
+        this.isWhite = false;
+      });
 
-      if (res.data.initPwd && !res.data.initRegInfo) {
+      console.log(res);
+
+      if (res.data && res.data.initPwd && !res.data.initRegInfo) {
         const res1 = await getRegInfo();
         this.active = 1;
         console.log(res1);
@@ -150,10 +154,10 @@
         }, 0);
       }
 
-      /* if (res.data.initPwd && res.data.initRegInfo) {
-        location.assign("/login");
+      if (res.data && res.data.initPwd && res.data.initRegInfo) {
+        location.assign("/view/login/");
         return;
-      } */
+      }
 
       this.isWhite = false;
     },

--
Gitblit v1.8.0