()
| 252 | }) |
| 253 | } |
| 254 | function readShareCode() { |
| 255 | console.log(`开始`) |
| 256 | return new Promise(async resolve => { |
| 257 | $.get({url: `http://share.turinglabs.net/api/v3/city/query/10/`, 'timeout': 10000}, (err, resp, data) => { |
| 258 | try { |
| 259 | if (err) { |
| 260 | console.log(`${JSON.stringify(err)}`) |
| 261 | console.log(`${$.name} API请求失败,请检查网路重试`) |
| 262 | } else { |
| 263 | if (data) { |
| 264 | data = JSON.parse(data); |
| 265 | } |
| 266 | } |
| 267 | } catch (e) { |
| 268 | $.logErr(e, resp) |
| 269 | } finally { |
| 270 | resolve(data); |
| 271 | } |
| 272 | }) |
| 273 | await $.wait(10000); |
| 274 | resolve() |
| 275 | }) |
| 276 | } |
| 277 | //格式化助力码 |
| 278 | function shareCodesFormat() { |
| 279 | return new Promise(async resolve => { |
no test coverage detected