mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-15 09:48:14 +08:00
🐛 获取延时,以避免 -110 报错
This commit is contained in:
@@ -139,14 +139,18 @@ async function confirmRefresh(): Promise<void> {
|
||||
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<void> {
|
||||
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<void> {
|
||||
});
|
||||
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}`,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user