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

Function shareCodesFormat

jd_fruit.js:1305–1324  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1303 })
1304}
1305function shareCodesFormat() {
1306 return new Promise(async resolve => {
1307 // console.log(`第${$.index}个京东账号的助力码:::${$.shareCodesArr[$.index - 1]}`)
1308 newShareCodes = [];
1309 if ($.shareCodesArr[$.index - 1]) {
1310 newShareCodes = $.shareCodesArr[$.index - 1].split('@');
1311 } else {
1312 console.log(`由于您第${$.index}个京东账号未提供shareCode,将采纳本脚本自带的助力码\n`)
1313 const tempIndex = $.index > shareCodes.length ? (shareCodes.length - 1) : ($.index - 1);
1314 newShareCodes = shareCodes[tempIndex].split('@');
1315 }
1316 const readShareCodeRes = await readShareCode();
1317 if (readShareCodeRes && readShareCodeRes.code === 200) {
1318 // newShareCodes = newShareCodes.concat(readShareCodeRes.data || []);
1319 newShareCodes = [...new Set([...newShareCodes, ...(readShareCodeRes.data || [])])];
1320 }
1321 console.log(`第${$.index}个京东账号将要助力的好友${JSON.stringify(newShareCodes)}`)
1322 resolve();
1323 })
1324}
1325function requireConfig() {
1326 return new Promise(resolve => {
1327 console.log('开始获取配置文件\n')

Callers 1

jd_fruit.jsFile · 0.70

Calls 2

readShareCodeFunction · 0.70
logMethod · 0.45

Tested by

no test coverage detected