()
| 539 | $.plantBeanIndexResult = await request('plantBeanIndex');//plantBeanIndexBody |
| 540 | } |
| 541 | function readShareCode() { |
| 542 | return new Promise(async resolve => { |
| 543 | $.get({url: `http://www.helpu.cf/jdcodes/getcode.php?type=bean&num=${randomCount}`, timeout: 10000}, (err, resp, data) => { |
| 544 | try { |
| 545 | if (err) { |
| 546 | console.log(`${JSON.stringify(err)}`) |
| 547 | console.log(`${$.name} API请求失败,请检查网路重试`) |
| 548 | } else { |
| 549 | if (data) { |
| 550 | console.log(`随机取个${randomCount}码放到您固定的互助码后面(不影响已有固定互助)`) |
| 551 | data = JSON.parse(data); |
| 552 | } |
| 553 | } |
| 554 | } catch (e) { |
| 555 | $.logErr(e, resp) |
| 556 | } finally { |
| 557 | resolve(data); |
| 558 | } |
| 559 | }) |
| 560 | await $.wait(15000); |
| 561 | resolve() |
| 562 | }) |
| 563 | } |
| 564 | //提交互助码 |
| 565 | function submitCode() { |
| 566 | return new Promise(async resolve => { |
no test coverage detected