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

Function shareCodesFormat

jd_dreamFactory.js:1364–1382  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1362}
1363//格式化助力码
1364function shareCodesFormat() {
1365 return new Promise(async resolve => {
1366 // console.log(`第${$.index}个京东账号的助力码:::${$.shareCodesArr[$.index - 1]}`)
1367 $.newShareCodes = [];
1368 if ($.shareCodesArr[$.index - 1]) {
1369 $.newShareCodes = $.shareCodesArr[$.index - 1].split('@');
1370 } else {
1371 console.log(`由于您第${$.index}个京东账号未提供shareCode,将采纳本脚本自带的助力码\n`)
1372 const tempIndex = $.index > inviteCodes.length ? (inviteCodes.length - 1) : ($.index - 1);
1373 $.newShareCodes = inviteCodes[tempIndex].split('@');
1374 }
1375 const readShareCodeRes = await readShareCode();
1376 if (readShareCodeRes && readShareCodeRes.code === 200) {
1377 $.newShareCodes = [...new Set([...$.newShareCodes, ...(readShareCodeRes.data || [])])];
1378 }
1379 console.log(`第${$.index}个京东账号将要助力的好友${JSON.stringify($.newShareCodes)}`)
1380 resolve();
1381 })
1382}
1383function requireConfig() {
1384 return new Promise(async resolve => {
1385 tuanActiveId = $.isNode() ? (process.env.TUAN_ACTIVEID || tuanActiveId) : ($.getdata('tuanActiveId') || tuanActiveId);

Callers 1

helpFriendsFunction · 0.70

Calls 2

readShareCodeFunction · 0.70
logMethod · 0.45

Tested by

no test coverage detected