mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-07-09 22:44:13 +08:00
fix when return value of formatStaticCombineFilters is a empty array, program cannot run correctly
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user