()
| 1323 | }) |
| 1324 | } |
| 1325 | function requireConfig() { |
| 1326 | return new Promise(resolve => { |
| 1327 | console.log('开始获取配置文件\n') |
| 1328 | notify = $.isNode() ? require('./sendNotify') : ''; |
| 1329 | //Node.js用户请在jdCookie.js处填写京东ck; |
| 1330 | const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; |
| 1331 | const jdFruitShareCodes = $.isNode() ? require('./jdFruitShareCodes.js') : ''; |
| 1332 | //IOS等用户直接用NobyDa的jd cookie |
| 1333 | if ($.isNode()) { |
| 1334 | Object.keys(jdCookieNode).forEach((item) => { |
| 1335 | if (jdCookieNode[item]) { |
| 1336 | cookiesArr.push(jdCookieNode[item]) |
| 1337 | } |
| 1338 | }) |
| 1339 | if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {}; |
| 1340 | } else { |
| 1341 | cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item); |
| 1342 | } |
| 1343 | console.log(`共${cookiesArr.length}个京东账号\n`) |
| 1344 | $.shareCodesArr = []; |
| 1345 | if ($.isNode()) { |
| 1346 | Object.keys(jdFruitShareCodes).forEach((item) => { |
| 1347 | if (jdFruitShareCodes[item]) { |
| 1348 | $.shareCodesArr.push(jdFruitShareCodes[item]) |
| 1349 | } |
| 1350 | }) |
| 1351 | } else { |
| 1352 | if ($.getdata('jd_fruit_inviter')) $.shareCodesArr = $.getdata('jd_fruit_inviter').split('\n').filter(item => !!item); |
| 1353 | console.log(`\nBoxJs设置的${$.name}好友邀请码:${$.getdata('jd_fruit_inviter') ? $.getdata('jd_fruit_inviter') : '暂无'}\n`); |
| 1354 | } |
| 1355 | // console.log(`$.shareCodesArr::${JSON.stringify($.shareCodesArr)}`) |
| 1356 | // console.log(`jdFruitShareArr账号长度::${$.shareCodesArr.length}`) |
| 1357 | console.log(`您提供了${$.shareCodesArr.length}个账号的农场助力码\n`); |
| 1358 | resolve() |
| 1359 | }) |
| 1360 | } |
| 1361 | function TotalBean() { |
| 1362 | return new Promise(async resolve => { |
| 1363 | const options = { |
no test coverage detected