mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-07-12 16:01:38 +08:00
save autoStartupChatRecordId, chatStartupFrom in ChatStartupLog
This commit is contained in:
@@ -79,18 +79,20 @@ const runAutoChat = async () => {
|
||||
}
|
||||
|
||||
const hooks = {
|
||||
daemonInitialized: new AsyncSeriesHook(),
|
||||
puppeteerLaunched: new SyncHook(),
|
||||
pageLoaded: new SyncHook(),
|
||||
cookieWillSet: new SyncHook(['cookies']),
|
||||
userInfoResponse: new AsyncSeriesHook(['userInfo']),
|
||||
jobDetailIsGetFromRecommendList: new AsyncSeriesHook(['userInfo']),
|
||||
newChatWillStartup: new AsyncSeriesHook(['positionInfoDetail']),
|
||||
newChatStartup: new AsyncSeriesHook(['positionInfoDetail']),
|
||||
newChatStartup: new AsyncSeriesHook(['positionInfoDetail', 'chatRunningContext']),
|
||||
noPositionFoundForCurrentJob: new SyncHook(),
|
||||
noPositionFoundAfterTraverseAllJob: new SyncHook(),
|
||||
errorEncounter: new SyncHook(['errorInfo'])
|
||||
}
|
||||
initPlugins(hooks)
|
||||
await hooks.daemonInitialized.promise()
|
||||
pipeWriteRegardlessError(
|
||||
pipe,
|
||||
JSON.stringify({
|
||||
|
||||
@@ -18,6 +18,7 @@ import packageJson from '@geekgeekrun/launch-bosszhipin-login-page-with-preload-
|
||||
import { Target } from 'puppeteer'
|
||||
import { pipeWriteRegardlessError } from '../utils/pipe'
|
||||
import * as JSONStream from 'JSONStream'
|
||||
import { ChatStartupFrom } from '@geekgeekrun/sqlite-plugin/dist/entity/ChatStartupLog'
|
||||
|
||||
const __dirname = url.fileURLToPath(new URL('.', import.meta.url))
|
||||
const isRunFromUi = Boolean(process.env.MAIN_BOSSGEEKGO_UI_RUN_MODE)
|
||||
@@ -89,9 +90,16 @@ const attachRequestsListener = async (target: Target) => {
|
||||
const currentUserInfo = await page.evaluate(
|
||||
'document.querySelector(".job-detail-box").__vue__.$store.state.userInfo'
|
||||
)
|
||||
await saveChatStartupRecord(await dbInitPromise, currentJobData, {
|
||||
encryptUserId: currentUserInfo.encryptUserId
|
||||
})
|
||||
await saveChatStartupRecord(
|
||||
await dbInitPromise,
|
||||
currentJobData,
|
||||
{
|
||||
encryptUserId: currentUserInfo.encryptUserId
|
||||
},
|
||||
{
|
||||
chatStartupFrom: ChatStartupFrom.ManuallyFromRecommendList
|
||||
}
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user