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

Function shareCodesFormat

activity/jd_nian.js:1404–1422  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1402
1403//格式化助力码
1404function shareCodesFormat() {
1405 return new Promise(async resolve => {
1406 // console.log(`第${$.index}个京东账号的助力码:::${$.shareCodesArr[$.index - 1]}`)
1407 $.newShareCodes = [];
1408 if ($.shareCodesArr[$.index - 1]) {
1409 $.newShareCodes = $.shareCodesArr[$.index - 1].split('@');
1410 } else {
1411 console.log(`由于您第${$.index}个京东账号未提供shareCode,将采纳本脚本自带的助力码\n`)
1412 const tempIndex = $.index > inviteCodes.length ? (inviteCodes.length - 1) : ($.index - 1);
1413 $.newShareCodes = inviteCodes[tempIndex].split('@');
1414 }
1415 const readShareCodeRes = await readShareCode();
1416 if (readShareCodeRes && readShareCodeRes.code === 200) {
1417 $.newShareCodes = [...new Set([...$.newShareCodes, ...(readShareCodeRes.data || [])])];
1418 }
1419 console.log(`第${$.index}个京东账号将要助力的好友${JSON.stringify($.newShareCodes)}`)
1420 resolve();
1421 })
1422}
1423
1424function shareCodesFormatPk() {
1425 return new Promise(async resolve => {

Callers 1

jd_nian.jsFile · 0.70

Calls 2

readShareCodeFunction · 0.70
logMethod · 0.45

Tested by

no test coverage detected