()
| 1575 | } |
| 1576 | |
| 1577 | function readShareCode() { |
| 1578 | return new Promise(async resolve => { |
| 1579 | $.get({url: ``, timeout: 30 * 1000}, (err, resp, data) => { |
| 1580 | try { |
| 1581 | if (err) { |
| 1582 | //console.log(JSON.stringify(err)) |
| 1583 | //console.log(`${$.name} readShareCode API请求失败,请检查网路重试`) |
| 1584 | } else { |
| 1585 | if (data) { |
| 1586 | console.log(`\n随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`) |
| 1587 | data = JSON.parse(data); |
| 1588 | } |
| 1589 | } |
| 1590 | } catch (e) { |
| 1591 | $.logErr(e, resp) |
| 1592 | } finally { |
| 1593 | resolve(data); |
| 1594 | } |
| 1595 | }) |
| 1596 | await $.wait(30 * 1000); |
| 1597 | resolve() |
| 1598 | }) |
| 1599 | } |
| 1600 | //格式化助力码 |
| 1601 | function shareCodesFormat() { |
| 1602 | return new Promise(async resolve => { |
no test coverage detected