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

Function shareCodesFormat

jd_pet.js:508–528  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

506 })
507}
508function shareCodesFormat() {
509 return new Promise(async resolve => {
510 // console.log(`第${$.index}个京东账号的助力码:::${$.shareCodesArr[$.index - 1]}`)
511 newShareCodes = [];
512 if ($.shareCodesArr[$.index - 1]) {
513 newShareCodes = $.shareCodesArr[$.index - 1].split('@');
514 } else {
515 console.log(`由于您第${$.index}个京东账号未提供shareCode,将采纳本脚本自带的助力码\n`)
516 const tempIndex = $.index > shareCodes.length ? (shareCodes.length - 1) : ($.index - 1);
517 newShareCodes = shareCodes[tempIndex].split('@');
518 }
519 //因好友助力功能下线。故暂时屏蔽
520 const readShareCodeRes = await readShareCode();
521 //const readShareCodeRes = null;
522 if (readShareCodeRes && readShareCodeRes.code === 200) {
523 newShareCodes = [...new Set([...newShareCodes, ...(readShareCodeRes.data || [])])];
524 }
525 console.log(`第${$.index}个京东账号将要助力的好友${JSON.stringify(newShareCodes)}`)
526 resolve();
527 })
528}
529function requireConfig() {
530 return new Promise(resolve => {
531 console.log('开始获取东东萌宠配置文件\n')

Callers 1

jd_pet.jsFile · 0.70

Calls 2

readShareCodeFunction · 0.70
logMethod · 0.45

Tested by

no test coverage detected