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

Function shareCodesFormat

jd_crazy_joy.js:607–625  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

605}
606//格式化助力码
607function shareCodesFormat() {
608 return new Promise(async resolve => {
609 // console.log(`第${$.index}个京东账号的助力码:::${$.shareCodesArr[$.index - 1]}`)
610 $.newShareCodes = [];
611 if ($.shareCodesArr[$.index - 1]) {
612 $.newShareCodes = $.shareCodesArr[$.index - 1].split('@');
613 } else {
614 console.log(`由于您第${$.index}个京东账号未提供shareCode,将采纳本脚本自带的助力码\n`)
615 const tempIndex = $.index > inviteCodes.length ? (inviteCodes.length - 1) : ($.index - 1);
616 $.newShareCodes = inviteCodes[tempIndex].split('@');
617 }
618 const readShareCodeRes = await readShareCode();
619 if (readShareCodeRes && readShareCodeRes.code === 200) {
620 $.newShareCodes = [...new Set([...$.newShareCodes, ...(readShareCodeRes.data || [])])];
621 }
622 console.log(`第${$.index}个京东账号将要助力的好友${JSON.stringify($.newShareCodes)}`)
623 resolve();
624 })
625}
626
627function requireConfig() {
628 return new Promise(resolve => {

Callers 1

jd_crazy_joy.jsFile · 0.70

Calls 2

readShareCodeFunction · 0.70
logMethod · 0.45

Tested by

no test coverage detected