mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-07-05 22:31:23 +08:00
fix and ensure the execution sequence of download browser and check cookie file
This commit is contained in:
@@ -26,7 +26,8 @@ const props = defineProps({
|
||||
dependenciesStatus: {
|
||||
type: Object as PropType<Record<string, boolean>>,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
processWaitee: Object
|
||||
})
|
||||
|
||||
// shallow copy
|
||||
@@ -75,6 +76,7 @@ const processTasks = async () => {
|
||||
try {
|
||||
p.then(() => {
|
||||
if (!promiseList.length) {
|
||||
props.processWaitee?.resolve?.()
|
||||
props.dispose?.()
|
||||
}
|
||||
})
|
||||
|
||||
@@ -2,7 +2,7 @@ import { createApp } from 'vue'
|
||||
import ElementPlus from 'element-plus'
|
||||
import DependenciesSetupProgressIndicatorDialog from './index.vue'
|
||||
|
||||
export const mountGlobalDialog = (dependenciesStatus: Record<string, boolean>) => {
|
||||
export const mountGlobalDialog = (o: { dependenciesStatus: Record<string, boolean>, processWaitee? }) => {
|
||||
const containerElId = `elForDependenciesSetupProgressIndicatorDialog`
|
||||
|
||||
if (document.getElementById(containerElId)) {
|
||||
@@ -28,7 +28,8 @@ export const mountGlobalDialog = (dependenciesStatus: Record<string, boolean>) =
|
||||
dispose()
|
||||
},
|
||||
dispose,
|
||||
dependenciesStatus
|
||||
dependenciesStatus: o?.dependenciesStatus,
|
||||
processWaitee: o?.processWaitee
|
||||
}).use(ElementPlus)
|
||||
app.mount(containerEl)
|
||||
|
||||
|
||||
@@ -117,7 +117,8 @@ import { ref, onUnmounted, onMounted } from 'vue'
|
||||
import { checkCookieListFormat } from '../../../../common/utils/cookie'
|
||||
|
||||
const props = defineProps({
|
||||
dispose: Function
|
||||
dispose: Function,
|
||||
processWaitee: Object
|
||||
})
|
||||
|
||||
const cookieInvalid = ref(false)
|
||||
@@ -201,6 +202,7 @@ const handleSubmit = async () => {
|
||||
data: formContent.value.collectedCookies
|
||||
})
|
||||
ElMessage.success('Boss直聘 Cookie 保存成功')
|
||||
props.processWaitee?.resolve?.()
|
||||
props.dispose()
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { createApp } from 'vue'
|
||||
import ElementPlus from 'element-plus'
|
||||
import WaitForLogin from './index.vue'
|
||||
|
||||
export const mountGlobalDialog = () => {
|
||||
export const mountGlobalDialog = (o: { processWaitee? }) => {
|
||||
const containerElId = `elForWaitForLogin`
|
||||
|
||||
if (document.getElementById(containerElId)) {
|
||||
@@ -28,6 +28,7 @@ export const mountGlobalDialog = () => {
|
||||
dispose()
|
||||
},
|
||||
dispose,
|
||||
processWaitee: o?.processWaitee
|
||||
}).use(ElementPlus)
|
||||
app.mount(containerEl)
|
||||
|
||||
|
||||
@@ -23,12 +23,22 @@ onUnmounted(() => {
|
||||
;(async () => {
|
||||
const checkDependenciesResult = await electron.ipcRenderer.invoke('check-dependencies')
|
||||
if (Object.values(checkDependenciesResult).includes(false)) {
|
||||
mountDependenciesSetupProgressIndicatorDialog(checkDependenciesResult)
|
||||
const processWaitee = Promise.withResolvers()
|
||||
mountDependenciesSetupProgressIndicatorDialog({
|
||||
checkDependenciesResult, processWaitee
|
||||
})
|
||||
|
||||
await processWaitee.promise
|
||||
}
|
||||
|
||||
const isCookieFileValid = await electron.ipcRenderer.invoke('check-boss-zhipin-cookie-file')
|
||||
if (!isCookieFileValid) {
|
||||
mountWaitForLoginDialog()
|
||||
const processWaitee = Promise.withResolvers()
|
||||
mountWaitForLoginDialog({
|
||||
processWaitee
|
||||
})
|
||||
|
||||
await processWaitee.promise
|
||||
}
|
||||
})()
|
||||
</script>
|
||||
|
||||
8
pnpm-lock.yaml
generated
8
pnpm-lock.yaml
generated
@@ -1,9 +1,5 @@
|
||||
lockfileVersion: '6.0'
|
||||
|
||||
settings:
|
||||
autoInstallPeers: true
|
||||
excludeLinksFromLockfile: false
|
||||
|
||||
importers:
|
||||
|
||||
.:
|
||||
@@ -5465,3 +5461,7 @@ packages:
|
||||
resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}
|
||||
engines: {node: '>=10'}
|
||||
dev: true
|
||||
|
||||
settings:
|
||||
autoInstallPeers: true
|
||||
excludeLinksFromLockfile: false
|
||||
|
||||
Reference in New Issue
Block a user