()
| 563 | } |
| 564 | //提交互助码 |
| 565 | function submitCode() { |
| 566 | return new Promise(async resolve => { |
| 567 | $.get({url: `http://www.helpu.cf/jdcodes/submit.php?code=${$.myPlantUuid}&type=bean`, timeout: 10000}, (err, resp, data) => { |
| 568 | try { |
| 569 | if (err) { |
| 570 | console.log(`${JSON.stringify(err)}`) |
| 571 | console.log(`${$.name} API请求失败,请检查网路重试`) |
| 572 | } else { |
| 573 | if (data) { |
| 574 | //console.log(`随机取个${randomCount}码放到您固定的互助码后面(不影响已有固定互助)`) |
| 575 | data = JSON.parse(data); |
| 576 | } |
| 577 | } |
| 578 | } catch (e) { |
| 579 | $.logErr(e, resp) |
| 580 | } finally { |
| 581 | resolve(data); |
| 582 | } |
| 583 | }) |
| 584 | await $.wait(15000); |
| 585 | resolve() |
| 586 | }) |
| 587 | } |
| 588 | //格式化助力码 |
| 589 | function shareCodesFormat() { |
| 590 | return new Promise(async resolve => { |
no test coverage detected