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

Function shareCodesFormat

jd_jdzz.js:250–268  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

248}
249//格式化助力码
250function shareCodesFormat() {
251 return new Promise(async resolve => {
252 // console.log(`第${$.index}个京东账号的助力码:::${$.shareCodesArr[$.index - 1]}`)
253 $.newShareCodes = [];
254 if ($.shareCodesArr[$.index - 1]) {
255 $.newShareCodes = $.shareCodesArr[$.index - 1].split('@');
256 } else {
257 console.log(`由于您第${$.index}个京东账号未提供shareCode,将采纳本脚本自带的助力码\n`)
258 const tempIndex = $.index > inviteCodes.length ? (inviteCodes.length - 1) : ($.index - 1);
259 $.newShareCodes = inviteCodes[tempIndex].split('@');
260 }
261// const readShareCodeRes = await readShareCode();
262// if (readShareCodeRes && readShareCodeRes.code === 200) {
263// $.newShareCodes = [...new Set([...$.newShareCodes, ...(readShareCodeRes.data || [])])];
264// }
265 console.log(`第${$.index}个京东账号将要助力的好友${JSON.stringify($.newShareCodes)}`)
266 resolve();
267 })
268}
269
270function requireConfig() {
271 return new Promise(resolve => {

Callers 1

jd_jdzz.jsFile · 0.70

Calls 1

logMethod · 0.45

Tested by

no test coverage detected