()
| 602 | } |
| 603 | } |
| 604 | function printAPI() { |
| 605 | return new Promise(resolve => { |
| 606 | $.get({url: `${printUrl}`, 'timeout': 10000}, (err, resp, data) => { |
| 607 | try { |
| 608 | if (err) { |
| 609 | console.log(`${JSON.stringify(err)}`) |
| 610 | console.log(`${$.name} API请求失败,请检查网路重试`) |
| 611 | } else { |
| 612 | data = JSON.parse(data); |
| 613 | } |
| 614 | } catch (e) { |
| 615 | $.logErr(e, resp) |
| 616 | } finally { |
| 617 | resolve(data); |
| 618 | } |
| 619 | }) |
| 620 | }) |
| 621 | } |
| 622 | function toHelp(code) { |
| 623 | return new Promise(resolve => { |
| 624 | const options = { |