mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-09-08 17:09:07 +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] : []
|
industryList: condition.industry ? [condition.industry] : []
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
result.unshift(null)
|
if (!result.length) {
|
||||||
|
result.push({
|
||||||
|
salaryList: [],
|
||||||
|
experienceList: [],
|
||||||
|
degreeList: [],
|
||||||
|
scaleList: [],
|
||||||
|
industryList: []
|
||||||
|
})
|
||||||
|
}
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -535,10 +535,11 @@ async function toRecommendPage (hooks) {
|
|||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
return res.json()
|
return res.json()
|
||||||
})
|
})
|
||||||
await Promise.all([
|
page.goto(recommendJobPageUrl, { timeout: 1 * 1000 }).catch(e => { void e })
|
||||||
page.goto(recommendJobPageUrl, { timeout: 120 * 1000 }),
|
await sleep(3000)
|
||||||
page.waitForNavigation(),
|
await page.waitForFunction(() => {
|
||||||
])
|
return document.readyState === 'complete'
|
||||||
|
}, { timeout: 120 * 1000 })
|
||||||
if (
|
if (
|
||||||
page.url().startsWith('https://www.zhipin.com/web/common/403.html') ||
|
page.url().startsWith('https://www.zhipin.com/web/common/403.html') ||
|
||||||
page.url().startsWith('https://www.zhipin.com/web/common/error.html')
|
page.url().startsWith('https://www.zhipin.com/web/common/error.html')
|
||||||
|
|||||||
Reference in New Issue
Block a user