From c663b1be1c2c89316dcd633979875317642a4828 Mon Sep 17 00:00:00 2001 From: geekgeekrun Date: Tue, 27 Jan 2026 16:55:32 +0800 Subject: [PATCH] change timeout of get user info --- packages/geek-auto-start-chat-with-boss/index.mjs | 4 ++-- packages/sqlite-plugin/src/index.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/geek-auto-start-chat-with-boss/index.mjs b/packages/geek-auto-start-chat-with-boss/index.mjs index 9e94219..3657863 100644 --- a/packages/geek-auto-start-chat-with-boss/index.mjs +++ b/packages/geek-auto-start-chat-with-boss/index.mjs @@ -611,7 +611,7 @@ async function toRecommendPage (hooks) { return true } return false - }).then((res) => { + }, { timeout: 120 * 1000 }).then((res) => { return res.json() }) page.goto(recommendJobPageUrl, { timeout: 1 * 1000 }).catch(e => { void e }) @@ -634,7 +634,7 @@ async function toRecommendPage (hooks) { let userInfoResponse = await userInfoPromise await hooks.userInfoResponse?.promise(userInfoResponse) - if (userInfoResponse.code !== 0) { + if (userInfoResponse?.code !== 0) { autoStartChatEventBus.emit('LOGIN_STATUS_INVALID', { userInfoResponse }) diff --git a/packages/sqlite-plugin/src/index.ts b/packages/sqlite-plugin/src/index.ts index cfb0e92..d00457c 100644 --- a/packages/sqlite-plugin/src/index.ts +++ b/packages/sqlite-plugin/src/index.ts @@ -100,7 +100,7 @@ export default class SqlitePlugin { hooks.userInfoResponse.tapPromise( "SqlitePlugin", async (userInfoResponse) => { - if (userInfoResponse.code !== 0) { + if (!userInfoResponse || userInfoResponse.code !== 0) { return; } const { zpData: userInfo } = userInfoResponse;