mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-09-06 07:57:06 +08:00
refactor json parser to json5
This commit is contained in:
@@ -9,10 +9,11 @@ import {
|
|||||||
import fs from 'node:fs'
|
import fs from 'node:fs'
|
||||||
import { get__dirname } from '@bossgeekgo/utils/legacy-path.mjs';
|
import { get__dirname } from '@bossgeekgo/utils/legacy-path.mjs';
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
|
import JSON5 from 'json5'
|
||||||
|
|
||||||
puppeteer.use(StealthPlugin())
|
puppeteer.use(StealthPlugin())
|
||||||
|
|
||||||
const { cookies: bossCookies } = JSON.parse(
|
const { cookies: bossCookies } = JSON5.parse(
|
||||||
fs.readFileSync(
|
fs.readFileSync(
|
||||||
path.join(
|
path.join(
|
||||||
get__dirname(),
|
get__dirname(),
|
||||||
@@ -21,7 +22,7 @@ const { cookies: bossCookies } = JSON.parse(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
const targetCompanyList = JSON.parse(
|
const targetCompanyList = JSON5.parse(
|
||||||
fs.readFileSync(
|
fs.readFileSync(
|
||||||
path.join(
|
path.join(
|
||||||
get__dirname(),
|
get__dirname(),
|
||||||
|
|||||||
@@ -7,8 +7,9 @@ import {
|
|||||||
import fs from 'node:fs'
|
import fs from 'node:fs'
|
||||||
import path from 'node:path'
|
import path from 'node:path'
|
||||||
import { get__dirname } from '@bossgeekgo/utils/legacy-path.mjs';
|
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(
|
fs.readFileSync(
|
||||||
path.join(
|
path.join(
|
||||||
get__dirname(),
|
get__dirname(),
|
||||||
|
|||||||
Reference in New Issue
Block a user