From 4e23970a6c6fa7aef549d7e9e647a25788f84706 Mon Sep 17 00:00:00 2001 From: BTMuli Date: Sun, 10 Sep 2023 18:22:40 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E8=8E=B7=E5=8F=96=E5=BB=B6?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E4=BB=A5=E9=81=BF=E5=85=8D=20-110=20?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/User/Gacha.vue | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/pages/User/Gacha.vue b/src/pages/User/Gacha.vue index 9ec9948c..e7986f53 100644 --- a/src/pages/User/Gacha.vue +++ b/src/pages/User/Gacha.vue @@ -139,14 +139,18 @@ async function confirmRefresh(): Promise { loadingTitle.value = "数据获取完成,即将刷新页面"; loadingSub.value = ""; loading.value = false; - setTimeout(() => { - window.location.reload(); - }, 1000); + await new Promise((resolve) => { + setTimeout(() => { + resolve(""); + }, 1000); + }); + window.location.reload(); } // 获取祈愿数据并写入数据库 async function getGachaLogs(pool: string, endId: string = "0"): Promise { const gachaRes = await TGRequest.User.getGachaLog(authkey.value, pool, endId); + console.log(pool, endId, gachaRes); if (Array.isArray(gachaRes)) { const uigfList: TGApp.Plugins.UIGF.GachaItem[] = []; gachaRes.forEach((item) => { @@ -173,8 +177,18 @@ async function getGachaLogs(pool: string, endId: string = "0"): Promise { }); await TGSqlite.mergeUIGF(account.gameUid, uigfList); if (gachaRes.length === 20) { + await new Promise((resolve) => { + setTimeout(() => { + resolve(""); + }, 1000); + }); await getGachaLogs(pool, gachaRes[gachaRes.length - 1].id); } + } else { + showSnackbar({ + color: "error", + text: `[${pool}][${gachaRes.retcode}] ${gachaRes.message}`, + }); } }