()
| 743 | } |
| 744 | |
| 745 | function readShareCode() { |
| 746 | console.log(`开始`) |
| 747 | return new Promise(async resolve => { |
| 748 | $.get({url: `http://share.turinglabs.net/api/v3/carnivalcity/query/20/`, 'timeout': 20000}, (err, resp, data) => { |
| 749 | try { |
| 750 | if (err) { |
| 751 | console.log(`${JSON.stringify(err)}`) |
| 752 | console.log(`${$.name} API请求失败,请检查网路重试`) |
| 753 | } else { |
| 754 | if (data) { |
| 755 | data = JSON.parse(data); |
| 756 | } |
| 757 | } |
| 758 | } catch (e) { |
| 759 | $.logErr(e, resp) |
| 760 | } finally { |
| 761 | resolve(data); |
| 762 | } |
| 763 | }) |
| 764 | await $.wait(20000); |
| 765 | resolve() |
| 766 | }) |
| 767 | } |
| 768 | //格式化助力码 |
| 769 | function shareCodesFormat() { |
| 770 | return new Promise(async resolve => { |
no test coverage detected