()
| 651 | } |
| 652 | //提交互助码 |
| 653 | function submitCode() { |
| 654 | return new Promise(async resolve => { |
| 655 | $.get({url: `http://www.helpu.cf/jdcodes/submit.php?code=${myInviteCode}&type=ddfactory`, timeout: 10000}, (err, resp, data) => { |
| 656 | try { |
| 657 | if (err) { |
| 658 | console.log(`${JSON.stringify(err)}`) |
| 659 | console.log(`${$.name} API请求失败,请检查网路重试`) |
| 660 | } else { |
| 661 | if (data) { |
| 662 | //console.log(`随机取个${randomCount}码放到您固定的互助码后面(不影响已有固定互助)`) |
| 663 | data = JSON.parse(data); |
| 664 | } |
| 665 | } |
| 666 | } catch (e) { |
| 667 | $.logErr(e, resp) |
| 668 | } finally { |
| 669 | resolve(data); |
| 670 | } |
| 671 | }) |
| 672 | await $.wait(15000); |
| 673 | resolve() |
| 674 | }) |
| 675 | } |
| 676 | //格式化助力码 |
| 677 | function shareCodesFormat() { |
| 678 | return new Promise(async resolve => { |
no test coverage detected