()
| 1381 | }) |
| 1382 | } |
| 1383 | function requireConfig() { |
| 1384 | return new Promise(async resolve => { |
| 1385 | tuanActiveId = $.isNode() ? (process.env.TUAN_ACTIVEID || tuanActiveId) : ($.getdata('tuanActiveId') || tuanActiveId); |
| 1386 | if (!tuanActiveId) { |
| 1387 | await updateTuanIdsCDN(); |
| 1388 | if ($.tuanConfigs && $.tuanConfigs['tuanActiveId']) { |
| 1389 | tuanActiveId = $.tuanConfigs['tuanActiveId']; |
| 1390 | console.log(`拼团活动ID: 获取成功 ${tuanActiveId}\n`) |
| 1391 | } else { |
| 1392 | if (!$.tuanConfigs) { |
| 1393 | await updateTuanIdsCDN('https://raw.githubusercontent.com/JDHelloWorld/jd_scripts/main/tools/empty.json'); |
| 1394 | if ($.tuanConfigs && $.tuanConfigs['tuanActiveId']) { |
| 1395 | tuanActiveId = $.tuanConfigs['tuanActiveId']; |
| 1396 | console.log(`拼团活动ID: 获取成功 ${tuanActiveId}\n`) |
| 1397 | } else { |
| 1398 | console.log(`拼团活动ID:获取失败,将采取脚本内置活动ID\n`) |
| 1399 | } |
| 1400 | } |
| 1401 | } |
| 1402 | } else { |
| 1403 | console.log(`自定义拼团活动ID: 获取成功 ${tuanActiveId}`) |
| 1404 | } |
| 1405 | console.log(`开始获取${$.name}配置文件\n`); |
| 1406 | //Node.js用户请在jdCookie.js处填写京东ck; |
| 1407 | const shareCodes = $.isNode() ? require('./jdDreamFactoryShareCodes.js') : ''; |
| 1408 | console.log(`共${cookiesArr.length}个京东账号\n`); |
| 1409 | $.shareCodesArr = []; |
| 1410 | if ($.isNode()) { |
| 1411 | Object.keys(shareCodes).forEach((item) => { |
| 1412 | if (shareCodes[item]) { |
| 1413 | $.shareCodesArr.push(shareCodes[item]) |
| 1414 | } |
| 1415 | }) |
| 1416 | } else { |
| 1417 | if ($.getdata('jd_jxFactory')) $.shareCodesArr = $.getdata('jd_jxFactory').split('\n').filter(item => item !== "" && item !== null && item !== undefined); |
| 1418 | console.log(`\nBoxJs设置的${$.name}好友邀请码:${$.getdata('jd_jxFactory')}\n`); |
| 1419 | } |
| 1420 | // console.log(`\n种豆得豆助力码::${JSON.stringify($.shareCodesArr)}`); |
| 1421 | console.log(`您提供了${$.shareCodesArr.length}个账号的${$.name}助力码\n`); |
| 1422 | resolve() |
| 1423 | }) |
| 1424 | } |
| 1425 | function TotalBean() { |
| 1426 | return new Promise(async resolve => { |
| 1427 | const options = { |
no test coverage detected