From fe1f16584e22cb94e11718915a988d5b63a31d4e Mon Sep 17 00:00:00 2001 From: BTMuli Date: Thu, 5 Oct 2023 16:01:08 +0800 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E6=8A=A5=E9=94=99=EF=BC=8C=E9=BB=98=E8=AE=A4=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E4=B8=A4=E6=9C=9F=20#48?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/User/Abyss.vue | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/pages/User/Abyss.vue b/src/pages/User/Abyss.vue index 8f28dcb0..01cd9833 100644 --- a/src/pages/User/Abyss.vue +++ b/src/pages/User/Abyss.vue @@ -123,19 +123,31 @@ async function getAbyssData(): Promise { ltoken: abyssCookie.ltoken, ltuid: abyssCookie.ltuid, }; - if (localAbyssID.value.length < 2) { - loadingTitle.value = "正在获取上期深渊数据"; - const resP = await TGRequest.User.byCookie.getAbyss(cookie, "2", user.value); - if (!("retcode" in resP)) { - loadingTitle.value = "正在保存上期深渊数据"; - await TGSqlite.saveAbyss(user.value.gameUid, resP); - } + loadingTitle.value = "正在获取上期深渊数据"; + const resP = await TGRequest.User.byCookie.getAbyss(cookie, "2", user.value); + if (!("retcode" in resP)) { + loadingTitle.value = "正在保存上期深渊数据"; + await TGSqlite.saveAbyss(user.value.gameUid, resP); + } else { + showSnackbar({ + text: `[${resP.retcode}]${resP.message}`, + color: "error", + }); + loading.value = false; + return; } loadingTitle.value = "正在获取本期深渊数据"; const res = await TGRequest.User.byCookie.getAbyss(cookie, "1", user.value); if (!("retcode" in res)) { loadingTitle.value = "正在保存本期深渊数据"; await TGSqlite.saveAbyss(user.value.gameUid, res); + } else { + showSnackbar({ + text: `[${res.retcode}]${res.message}`, + color: "error", + }); + loading.value = false; + return; } loadingTitle.value = "正在加载深渊数据"; await initAbyssData();