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

Function shareCodesFormat

jd_jdfactory.js:677–695  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

675}
676//格式化助力码
677function shareCodesFormat() {
678 return new Promise(async resolve => {
679 // console.log(`第${$.index}个京东账号的助力码:::${$.shareCodesArr[$.index - 1]}`)
680 $.newShareCodes = [];
681 if ($.shareCodesArr[$.index - 1]) {
682 $.newShareCodes = $.shareCodesArr[$.index - 1].split('@');
683 } else {
684 console.log(`由于您第${$.index}个京东账号未提供shareCode,将采纳本脚本自带的助力码\n`)
685 const tempIndex = $.index > inviteCodes.length ? (inviteCodes.length - 1) : ($.index - 1);
686 $.newShareCodes = inviteCodes[tempIndex].split('@');
687 }
688 const readShareCodeRes = await readShareCode();
689 if (readShareCodeRes && readShareCodeRes.code === 200) {
690 $.newShareCodes = [...new Set([...$.newShareCodes, ...(readShareCodeRes.data || [])])];
691 }
692 console.log(`第${$.index}个京东账号将要助力的好友${JSON.stringify($.newShareCodes)}`)
693 resolve();
694 })
695}
696function requireConfig() {
697 return new Promise(resolve => {
698 console.log(`开始获取${$.name}配置文件\n`);

Callers 1

jd_jdfactory.jsFile · 0.70

Calls 2

readShareCodeFunction · 0.70
logMethod · 0.45

Tested by

no test coverage detected