refactor json parser to json5

This commit is contained in:
bossgeekgo
2024-02-11 23:51:47 +08:00
parent 36bc5a9cdd
commit 9eb6d4c3f2
2 changed files with 5 additions and 3 deletions

View File

@@ -9,10 +9,11 @@ import {
import fs from 'node:fs'
import { get__dirname } from '@bossgeekgo/utils/legacy-path.mjs';
import path from 'node:path';
import JSON5 from 'json5'
puppeteer.use(StealthPlugin())
const { cookies: bossCookies } = JSON.parse(
const { cookies: bossCookies } = JSON5.parse(
fs.readFileSync(
path.join(
get__dirname(),
@@ -21,7 +22,7 @@ const { cookies: bossCookies } = JSON.parse(
)
)
const targetCompanyList = JSON.parse(
const targetCompanyList = JSON5.parse(
fs.readFileSync(
path.join(
get__dirname(),

View File

@@ -7,8 +7,9 @@ import {
import fs from 'node:fs'
import path from 'node:path'
import { get__dirname } from '@bossgeekgo/utils/legacy-path.mjs';
import JSON5 from 'json5'
const { groupRobotAccessToken: dingTalkAccessToken } = JSON.parse(
const { groupRobotAccessToken: dingTalkAccessToken } = JSON5.parse(
fs.readFileSync(
path.join(
get__dirname(),