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

Function shareCodesFormat

jd_bookshop.js:659–677  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

657
658//格式化助力码
659function shareCodesFormat() {
660 return new Promise(async resolve => {
661 // console.log(`第${$.index}个京东账号的助力码:::${$.shareCodesArr[$.index - 1]}`)
662 $.newShareCodes = [];
663 if ($.shareCodesArr[$.index - 1]) {
664 $.newShareCodes = $.shareCodesArr[$.index - 1].split('@');
665 } else {
666 console.log(`由于您第${$.index}个京东账号未提供shareCode,将采纳本脚本自带的助力码\n`)
667 const tempIndex = $.index > inviteCodes.length ? (inviteCodes.length - 1) : ($.index - 1);
668 $.newShareCodes = inviteCodes[tempIndex].split('@');
669 }
670 const readShareCodeRes = null //await readShareCode();
671 if (readShareCodeRes && readShareCodeRes.code === 200) {
672 $.newShareCodes = [...new Set([...$.newShareCodes, ...(readShareCodeRes.data || [])])];
673 }
674 console.log(`第${$.index}个京东账号将要助力的好友${JSON.stringify($.newShareCodes)}`)
675 resolve();
676 })
677}
678
679function requireConfig() {
680 return new Promise(resolve => {

Callers 1

jd_bookshop.jsFile · 0.70

Calls 1

logMethod · 0.45

Tested by

no test coverage detected