MCPcopy Create free account
hub / github.com/Semporia/Scripts / requireConfig

Function requireConfig

jd_EsportsManager.js:486–507  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

484}
485
486function requireConfig() {
487 return new Promise(resolve => {
488 console.log('开始获取配置文件\n')
489 notify = $.isNode() ? require('./sendNotify') : '';
490 //Node.js用户请在jdCookie.js处填写京东ck;
491 const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
492 //IOS等用户直接用NobyDa的jd cookie
493 if ($.isNode()) {
494 Object.keys(jdCookieNode).forEach((item) => {
495 if (jdCookieNode[item]) {
496 cookiesArr.push(jdCookieNode[item])
497 }
498 })
499 if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {
500 };
501 } else {
502 cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item);
503 }
504 console.log(`共${cookiesArr.length}个京东账号\n`)
505 resolve()
506 })
507}
508
509function jsonParse(str) {
510 if (typeof str == "string") {

Callers 1

Calls 4

jsonParseFunction · 0.70
logMethod · 0.45
isNodeMethod · 0.45
getdataMethod · 0.45

Tested by

no test coverage detected