mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-09-05 23:47:54 +08:00
fix the bug nothing happen when call storeStorage - page argument is lost; call storeStorage to update out stored cookie and local storage.
This commit is contained in:
@@ -122,7 +122,7 @@ export async function mainLoop (hooks) {
|
|||||||
writeStorageFile('boss-cookies.json', [])
|
writeStorageFile('boss-cookies.json', [])
|
||||||
throw new Error("LOGIN_STATUS_INVALID")
|
throw new Error("LOGIN_STATUS_INVALID")
|
||||||
} else {
|
} else {
|
||||||
await storeStorage().catch(() => void 0)
|
await storeStorage(page).catch(() => void 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
const INIT_START_EXCEPT_JOB_INDEX = 1
|
const INIT_START_EXCEPT_JOB_INDEX = 1
|
||||||
@@ -156,6 +156,7 @@ export async function mainLoop (hooks) {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
await storeStorage(page).catch(() => void 0)
|
||||||
await sleepWithRandomDelay(2000)
|
await sleepWithRandomDelay(2000)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -275,6 +276,7 @@ export async function mainLoop (hooks) {
|
|||||||
if (res.code !== 0) {
|
if (res.code !== 0) {
|
||||||
// startup chat error, may the chance of today has used out
|
// startup chat error, may the chance of today has used out
|
||||||
if (res.zpData.bizCode === 1 && res.zpData.bizData?.chatRemindDialog?.blockLevel === 0 && res.zpData.bizData?.chatRemindDialog?.content === `今日沟通人数已达上限,请明天再试`) {
|
if (res.zpData.bizCode === 1 && res.zpData.bizData?.chatRemindDialog?.blockLevel === 0 && res.zpData.bizData?.chatRemindDialog?.content === `今日沟通人数已达上限,请明天再试`) {
|
||||||
|
await storeStorage(page).catch(() => void 0)
|
||||||
throw new Error('STARTUP_CHAT_ERROR_DUE_TO_TODAY_CHANCE_HAS_USED_OUT')
|
throw new Error('STARTUP_CHAT_ERROR_DUE_TO_TODAY_CHANCE_HAS_USED_OUT')
|
||||||
} else {
|
} else {
|
||||||
console.error(res)
|
console.error(res)
|
||||||
@@ -284,6 +286,7 @@ export async function mainLoop (hooks) {
|
|||||||
hooks.newChatStartup?.call(jobData)
|
hooks.newChatStartup?.call(jobData)
|
||||||
blockBossNotNewChat.add(jobData.jobInfo.encryptUserId)
|
blockBossNotNewChat.add(jobData.jobInfo.encryptUserId)
|
||||||
|
|
||||||
|
await storeStorage(page).catch(() => void 0)
|
||||||
await sleepWithRandomDelay(750)
|
await sleepWithRandomDelay(750)
|
||||||
const closeDialogButtonProxy = await page.$('.greet-boss-dialog .greet-boss-footer .cancel-btn')
|
const closeDialogButtonProxy = await page.$('.greet-boss-dialog .greet-boss-footer .cancel-btn')
|
||||||
await closeDialogButtonProxy.click()
|
await closeDialogButtonProxy.click()
|
||||||
|
|||||||
Reference in New Issue
Block a user