()
| 580 | } |
| 581 | } |
| 582 | function readShareCode() { |
| 583 | console.log(`开始`) |
| 584 | return new Promise(async resolve => { |
| 585 | $.get({url: `https://code.chiang.fun/api/v1/jd/jdcrazyjoy/read/${randomCount}/`, 'timeout': 10000}, (err, resp, data) => { |
| 586 | try { |
| 587 | if (err) { |
| 588 | console.log(`${JSON.stringify(err)}`) |
| 589 | console.log(`${$.name} API请求失败,请检查网路重试`) |
| 590 | } else { |
| 591 | if (data) { |
| 592 | console.log(`随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`) |
| 593 | data = JSON.parse(data); |
| 594 | } |
| 595 | } |
| 596 | } catch (e) { |
| 597 | $.logErr(e, resp) |
| 598 | } finally { |
| 599 | resolve(data); |
| 600 | } |
| 601 | }) |
| 602 | await $.wait(10000); |
| 603 | resolve() |
| 604 | }) |
| 605 | } |
| 606 | //格式化助力码 |
| 607 | function shareCodesFormat() { |
| 608 | return new Promise(async resolve => { |
no test coverage detected