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;