fix when return value of formatStaticCombineFilters is a empty array, program cannot run correctly

This commit is contained in:
geekgeekrun
2025-12-10 13:15:55 +08:00
parent 0aef2af350
commit d206d45242
2 changed files with 14 additions and 5 deletions

View File

@@ -153,6 +153,14 @@ export function formatStaticCombineFilters(rawStaticCombineRecommendJobFilterCon
industryList: condition.industry ? [condition.industry] : []
}
})
result.unshift(null)
if (!result.length) {
result.push({
salaryList: [],
experienceList: [],
degreeList: [],
scaleList: [],
industryList: []
})
}
return result
}

View File

@@ -535,10 +535,11 @@ async function toRecommendPage (hooks) {
}).then((res) => {
return res.json()
})
await Promise.all([
page.goto(recommendJobPageUrl, { timeout: 120 * 1000 }),
page.waitForNavigation(),
])
page.goto(recommendJobPageUrl, { timeout: 1 * 1000 }).catch(e => { void e })
await sleep(3000)
await page.waitForFunction(() => {
return document.readyState === 'complete'
}, { timeout: 120 * 1000 })
if (
page.url().startsWith('https://www.zhipin.com/web/common/403.html') ||
page.url().startsWith('https://www.zhipin.com/web/common/error.html')