| 483 | } |
| 484 | //提交互助码 |
| 485 | function submitCode() { |
| 486 | return new Promise(async resolve => { |
| 487 | $.get({url: `http://www.helpu.cf/jdcodes/submit.php?code=${$.petInfo.shareCode}&type=pet`, timeout: 10000}, (err, resp, data) => { |
| 488 | try { |
| 489 | if (err) { |
| 490 | console.log(`${JSON.stringify(err)}`) |
| 491 | console.log(`${$.name} submitCode API请求失败,请检查网路重试`) |
| 492 | } else { |
| 493 | if (data) { |
| 494 | //console.log(`随机取个${randomCount}码放到您固定的互助码后面(不影响已有固定互助)`) |
| 495 | data = JSON.parse(data); |
| 496 | } |
| 497 | } |
| 498 | } catch (e) { |
| 499 | $.logErr(e, resp) |
| 500 | } finally { |
| 501 | resolve(data); |
| 502 | } |
| 503 | }) |
| 504 | await $.wait(15000); |
| 505 | resolve() |
| 506 | }) |
| 507 | } |
| 508 | function shareCodesFormat() { |
| 509 | return new Promise(async resolve => { |
| 510 | // console.log(`第${$.index}个京东账号的助力码:::${$.shareCodesArr[$.index - 1]}`) |