()
| 459 | } |
| 460 | } |
| 461 | function readShareCode() { |
| 462 | return new Promise(async resolve => { |
| 463 | $.get({url: `http://www.helpu.cf/jdcodes/getcode.php?type=pet&num=${randomCount}`, 'timeout': 10000}, (err, resp, data) => { |
| 464 | try { |
| 465 | if (err) { |
| 466 | console.log(`${JSON.stringify(err)}`) |
| 467 | console.log(`${$.name} readShareCode API请求失败,请检查网路重试`) |
| 468 | } else { |
| 469 | if (data) { |
| 470 | console.log(`随机取个${randomCount}码放到您固定的互助码后面(不影响已有固定互助)`) |
| 471 | data = JSON.parse(data); |
| 472 | } |
| 473 | } |
| 474 | } catch (e) { |
| 475 | $.logErr(e, resp) |
| 476 | } finally { |
| 477 | resolve(data); |
| 478 | } |
| 479 | }) |
| 480 | await $.wait(10000); |
| 481 | resolve() |
| 482 | }) |
| 483 | } |
| 484 | //提交互助码 |
| 485 | function submitCode() { |
| 486 | return new Promise(async resolve => { |
no test coverage detected