fix cannot run due to lodash-es is not bundled; fix logic about set security question tip modal

This commit is contained in:
geekgeekrun
2025-08-17 11:11:15 +08:00
parent 203fbba9a0
commit 42fc66a0f4
3 changed files with 27 additions and 17 deletions

View File

@@ -523,6 +523,11 @@ async function toRecommendPage (hooks) {
) {
throw new Error("ACCESS_IS_DENIED")
}
await page.waitForFunction(({ recommendJobPageUrl }) => {
return location.href.startsWith(recommendJobPageUrl) && document.readyState === 'complete'
}, undefined, { recommendJobPageUrl })
hooks.pageLoaded?.call()
let userInfoResponse = await userInfoPromise
@@ -537,20 +542,6 @@ async function toRecommendPage (hooks) {
await storeStorage(page).catch(() => void 0)
}
// check set security question tip modal
let setSecurityQuestionTipModelProxy = await page.$('.dialog-wrap.dialog-account-safe')
if (
setSecurityQuestionTipModelProxy
) {
await sleep(1000)
setSecurityQuestionTipModelProxy = await page.$('.dialog-wrap.dialog-account-safe')
const closeButtonProxy = await setSecurityQuestionTipModelProxy?.$('.close')
if (setSecurityQuestionTipModelProxy && closeButtonProxy) {
await closeButtonProxy.click()
}
}
const computedSourceList = []
for (const source of normalizedJobSource) {
switch (source.type) {
@@ -640,6 +631,26 @@ async function toRecommendPage (hooks) {
let currentSourceIndex = 0
afterPageLoad: while (true) {
// check set security question tip modal
let setSecurityQuestionTipModelProxy
try {
setSecurityQuestionTipModelProxy = await page.waitForSelector('.dialog-wrap.dialog-account-safe', { timeout: 3 * 1000 })
}
catch(err) {
console.log(`cannot find set security question tip modal, just continue`)
}
if (
setSecurityQuestionTipModelProxy
) {
await sleep(1000)
setSecurityQuestionTipModelProxy = await page.$('.dialog-wrap.dialog-account-safe')
const closeButtonProxy = await setSecurityQuestionTipModelProxy?.$('.close')
if (setSecurityQuestionTipModelProxy && closeButtonProxy) {
await closeButtonProxy.click()
}
}
let expectJobList
iterateFilterCondition: for (
const filterCondition of combineFiltersWithConstraintsGenerator(

View File

@@ -1,7 +1,6 @@
import "reflect-metadata";
import { type DataSource } from "typeorm";
import { requireTypeorm } from "./utils/module-loader";
import fs from 'node:fs'
import { BossInfo } from "./entity/BossInfo";
import { BossInfoChangeLog } from "./entity/BossInfoChangeLog";

View File

@@ -38,6 +38,7 @@
"JSONStream": "^1.3.5",
"diff": "^7.0.0",
"electron-updater": "^6.1.7",
"lodash-es": "^4.17.21",
"minimist": "^1.2.8",
"mitt": "^3.0.1",
"node-machine-id": "^1.1.12",
@@ -72,7 +73,6 @@
"eslint-plugin-vue": "^9.20.1",
"find-chrome-bin": "^2.0.1",
"js-yaml": "^4.1.0",
"lodash-es": "^4.17.21",
"normalize.css": "^8.0.1",
"prettier": "^3.2.4",
"sass": "^1.70.0",
@@ -88,4 +88,4 @@
"vue-router": "^4.2.5",
"vue-tsc": "^1.8.27"
}
}
}