add logic to detect and handle login invalid - will exit auto start chat and show cookie assistant. add the logic to store cookie and local storage while auto start chat running.

This commit is contained in:
geekgeekrun
2024-03-03 23:28:36 +08:00
parent 6a7b402101
commit a25e7aedb9
7 changed files with 106 additions and 18 deletions
@@ -8,6 +8,7 @@ import defaultBossConf from './default-config-file/boss.json' assert {type: 'jso
import defaultTargetCompanyListConf from './default-config-file/target-company-list.json' assert {type: 'json'}
import defaultBossCookieStorage from './default-storage-file/boss-cookies.json' assert { type: 'json' }
import defaultBossLocalStorageStorage from './default-storage-file/boss-local-storage.json' assert { type: 'json' }
export const configFileNameList = ['boss.json', 'dingtalk.json', 'target-company-list.json']
const defaultConfigFileContentMap = {
@@ -90,7 +91,8 @@ export const storageFilePath = path.join(
export const storageFileNameList = ['boss-cookies.json']
const defaultStorageFileContentMap = {
'boss-cookies.json': JSON.stringify(defaultBossCookieStorage)
'boss-cookies.json': JSON.stringify(defaultBossCookieStorage),
'boss-local-storage.json': JSON.stringify(defaultBossLocalStorageStorage)
}
export const ensureStorageFileExist = () => {
ensureRuntimeFolderPathExist()