()
| 506 | }) |
| 507 | } |
| 508 | function shareCodesFormat() { |
| 509 | return new Promise(async resolve => { |
| 510 | // console.log(`第${$.index}个京东账号的助力码:::${$.shareCodesArr[$.index - 1]}`) |
| 511 | newShareCodes = []; |
| 512 | if ($.shareCodesArr[$.index - 1]) { |
| 513 | newShareCodes = $.shareCodesArr[$.index - 1].split('@'); |
| 514 | } else { |
| 515 | console.log(`由于您第${$.index}个京东账号未提供shareCode,将采纳本脚本自带的助力码\n`) |
| 516 | const tempIndex = $.index > shareCodes.length ? (shareCodes.length - 1) : ($.index - 1); |
| 517 | newShareCodes = shareCodes[tempIndex].split('@'); |
| 518 | } |
| 519 | //因好友助力功能下线。故暂时屏蔽 |
| 520 | const readShareCodeRes = await readShareCode(); |
| 521 | //const readShareCodeRes = null; |
| 522 | if (readShareCodeRes && readShareCodeRes.code === 200) { |
| 523 | newShareCodes = [...new Set([...newShareCodes, ...(readShareCodeRes.data || [])])]; |
| 524 | } |
| 525 | console.log(`第${$.index}个京东账号将要助力的好友${JSON.stringify(newShareCodes)}`) |
| 526 | resolve(); |
| 527 | }) |
| 528 | } |
| 529 | function requireConfig() { |
| 530 | return new Promise(resolve => { |
| 531 | console.log('开始获取东东萌宠配置文件\n') |
no test coverage detected