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 | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/pages/index/App.vue b/src/pages/index/App.vue index ebc00eb..892268e 100644 --- a/src/pages/index/App.vue +++ b/src/pages/index/App.vue @@ -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,7 +154,7 @@ }, 0); } - if (res.data.initPwd && res.data.initRegInfo) { + if (res.data && res.data.initPwd && res.data.initRegInfo) { location.assign("/view/login/"); return; } -- Gitblit v1.8.0