()
| 1303 | }) |
| 1304 | } |
| 1305 | function 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 | } |
| 1325 | function requireConfig() { |
| 1326 | return new Promise(resolve => { |
| 1327 | console.log('开始获取配置文件\n') |
no test coverage detected