mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-05-11 18:09:50 +08:00
Merge branch 'feature/ui'
This commit is contained in:
@@ -39,6 +39,9 @@ function combine(arr, min, max) {
|
||||
// 生成符合"0"限制的组合
|
||||
function combineWithZero(arr, min, max) {
|
||||
let combineResult;
|
||||
if (!Array.isArray(arr)) {
|
||||
arr = []
|
||||
}
|
||||
if (arr.includes(0)) {
|
||||
// 如果包含 0,0不参与组合
|
||||
combineResult = [].concat(
|
||||
|
||||
@@ -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
|
||||
})
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -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;
|
||||
|
||||
@@ -24,7 +24,7 @@ import { BossInfo } from '@geekgeekrun/sqlite-plugin/dist/entity/BossInfo'
|
||||
import { messageForSaveFilter } from '../../../common/utils/chat-list'
|
||||
import { RECHAT_CONTENT_SOURCE, RECHAT_LLM_FALLBACK } from '../../../common/enums/auto-start-chat'
|
||||
import gtag from '../../utils/gtag'
|
||||
import { JobHireStatus } from '@geekgeekrun/sqlite-plugin/dist/enums';
|
||||
import { JobHireStatus } from '@geekgeekrun/sqlite-plugin/dist/enums'
|
||||
import dayjs from 'dayjs'
|
||||
import cheerio from 'cheerio'
|
||||
|
||||
@@ -136,16 +136,24 @@ async function checkJobIsClosed() {
|
||||
}
|
||||
positionNameElHandle.click()
|
||||
try {
|
||||
const targetPage = await waitForPage(pageMapByName.boss!.browser(), async (page) => {
|
||||
const url = page.url()
|
||||
if (
|
||||
url.startsWith(`https://www.zhipin.com/job_detail/${encryptJobId}`) &&
|
||||
(await page.evaluate(() => document.readyState === 'complete'))
|
||||
) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
})
|
||||
const targetPage = await waitForPage(
|
||||
pageMapByName.boss!.browser(),
|
||||
async (page) => {
|
||||
const url = page.url()
|
||||
if (
|
||||
url.startsWith(`https://www.zhipin.com/job_detail/${encryptJobId}`) &&
|
||||
(await page.evaluate(
|
||||
() =>
|
||||
!!document.querySelector('#main .job-banner') ||
|
||||
!!document.documentElement.innerText?.includes(`您访问的页面不存在`)
|
||||
))
|
||||
) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
},
|
||||
{ timeout: 15 * 1000 }
|
||||
)
|
||||
const htmlContent = await targetPage.content()
|
||||
if (htmlContent) {
|
||||
const $ = cheerio.load(htmlContent)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>GeekBossGo</title>
|
||||
<title>GeekGeekRun 牛人快跑</title>
|
||||
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
|
||||
<meta
|
||||
http-equiv="Content-Security-Policy"
|
||||
|
||||
Reference in New Issue
Block a user