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