mirror of
https://github.com/earthjasonlin/zzz-signal-search-export.git
synced 2024-11-22 21:30:22 +08:00
fix: empty records may fail (#26)
This commit is contained in:
parent
dcaad1d544
commit
a2dcda6be0
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "star-rail-warp-export",
|
"name": "star-rail-warp-export",
|
||||||
"version": "0.0.15",
|
"version": "0.0.16",
|
||||||
"main": "./dist/electron/main/main.js",
|
"main": "./dist/electron/main/main.js",
|
||||||
"author": "biuuu <https://github.com/biuuu>",
|
"author": "biuuu <https://github.com/biuuu>",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
@ -163,7 +163,7 @@ const getGachaLog = async ({ key, page, name, retryCount, url, endId }) => {
|
|||||||
const text = i18n.log
|
const text = i18n.log
|
||||||
try {
|
try {
|
||||||
const res = await request(`${url}&gacha_type=${key}&page=${page}&size=${20}${endId ? '&end_id=' + endId : ''}`)
|
const res = await request(`${url}&gacha_type=${key}&page=${page}&size=${20}${endId ? '&end_id=' + endId : ''}`)
|
||||||
return res.data
|
return res?.data
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (retryCount) {
|
if (retryCount) {
|
||||||
sendMsg(i18n.parse(text.fetch.retry, { name, page, count: 6 - retryCount }))
|
sendMsg(i18n.parse(text.fetch.retry, { name, page, count: 6 - retryCount }))
|
||||||
@ -196,7 +196,7 @@ const getGachaLogs = async ({ name, key }, queryString) => {
|
|||||||
sendMsg(i18n.parse(text.fetch.current, { name, page }))
|
sendMsg(i18n.parse(text.fetch.current, { name, page }))
|
||||||
res = await getGachaLog({ key, page, name, url, endId, retryCount: 5 })
|
res = await getGachaLog({ key, page, name, url, endId, retryCount: 5 })
|
||||||
await sleep(0.3)
|
await sleep(0.3)
|
||||||
logs = res.list || []
|
logs = res?.list || []
|
||||||
if (!uid && logs.length) {
|
if (!uid && logs.length) {
|
||||||
uid = logs[0].uid
|
uid = logs[0].uid
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user