| 657 | |
| 658 | //格式化助力码 |
| 659 | function shareCodesFormat() { |
| 660 | return new Promise(async resolve => { |
| 661 | // console.log(`第${$.index}个京东账号的助力码:::${$.shareCodesArr[$.index - 1]}`) |
| 662 | $.newShareCodes = []; |
| 663 | if ($.shareCodesArr[$.index - 1]) { |
| 664 | $.newShareCodes = $.shareCodesArr[$.index - 1].split('@'); |
| 665 | } else { |
| 666 | console.log(`由于您第${$.index}个京东账号未提供shareCode,将采纳本脚本自带的助力码\n`) |
| 667 | const tempIndex = $.index > inviteCodes.length ? (inviteCodes.length - 1) : ($.index - 1); |
| 668 | $.newShareCodes = inviteCodes[tempIndex].split('@'); |
| 669 | } |
| 670 | const readShareCodeRes = null //await readShareCode(); |
| 671 | if (readShareCodeRes && readShareCodeRes.code === 200) { |
| 672 | $.newShareCodes = [...new Set([...$.newShareCodes, ...(readShareCodeRes.data || [])])]; |
| 673 | } |
| 674 | console.log(`第${$.index}个京东账号将要助力的好友${JSON.stringify($.newShareCodes)}`) |
| 675 | resolve(); |
| 676 | }) |
| 677 | } |
| 678 | |
| 679 | function requireConfig() { |
| 680 | return new Promise(resolve => { |