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

Function shareCodesFormat

activity/jd_apple_live.js:295–313  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

293}
294//格式化助力码
295function shareCodesFormat() {
296 return new Promise(async resolve => {
297 // console.log(`第${$.index}个京东账号的助力码:::${$.shareCodesArr[$.index - 1]}`)
298 $.newShareCodes = [];
299 if ($.shareCodesArr[$.index - 1]) {
300 $.newShareCodes = $.shareCodesArr[$.index - 1].split('@');
301 } else {
302 console.log(`由于您第${$.index}个京东账号未提供shareCode,将采纳本脚本自带的助力码\n`)
303 const tempIndex = $.index > inviteCodes.length ? (inviteCodes.length - 1) : ($.index - 1);
304 $.newShareCodes = inviteCodes[tempIndex].split('@');
305 }
306 const readShareCodeRes = null //await readShareCode();
307 if (readShareCodeRes && readShareCodeRes.code === 200) {
308 $.newShareCodes = [...new Set([...$.newShareCodes, ...(readShareCodeRes.data || [])])];
309 }
310 console.log(`第${$.index}个京东账号将要助力的好友${JSON.stringify($.newShareCodes)}`)
311 resolve();
312 })
313}
314function requireConfig() {
315 return new Promise(resolve => {
316 console.log(`开始获取${$.name}配置文件\n`);

Callers 1

jd_apple_live.jsFile · 0.70

Calls 1

logMethod · 0.45

Tested by

no test coverage detected