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

Function shareCodesFormat

activity/jd_pubg.js:342–360  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

340}
341//格式化助力码
342function shareCodesFormat() {
343 return new Promise(async resolve => {
344 // console.log(`第${$.index}个京东账号的助力码:::${$.shareCodesArr[$.index - 1]}`)
345 $.newShareCodes = [];
346 if ($.shareCodesArr[$.index - 1]) {
347 $.newShareCodes = $.shareCodesArr[$.index - 1].split('@');
348 } else {
349 console.log(`由于您第${$.index}个京东账号未提供shareCode,将采纳本脚本自带的助力码\n`)
350 const tempIndex = $.index > inviteCodes.length ? (inviteCodes.length - 1) : ($.index - 1);
351 $.newShareCodes = inviteCodes[tempIndex].split('@');
352 }
353 const readShareCodeRes = null //await readShareCode();
354 if (readShareCodeRes && readShareCodeRes.code === 200) {
355 $.newShareCodes = [...new Set([...$.newShareCodes, ...(readShareCodeRes.data || [])])];
356 }
357 console.log(`第${$.index}个京东账号将要助力的好友${JSON.stringify($.newShareCodes)}`)
358 resolve();
359 })
360}
361function requireConfig() {
362 return new Promise(resolve => {
363 console.log(`开始获取${$.name}配置文件\n`);

Callers 1

jd_pubg.jsFile · 0.70

Calls 1

logMethod · 0.45

Tested by

no test coverage detected