()
| 355 | }) |
| 356 | } |
| 357 | function readShareCode() { |
| 358 | console.log(`开始`) |
| 359 | return new Promise(async resolve => { |
| 360 | $.get({url: `http://www.helpu.cf/jdcodes/getcode.php?type=cash&num=${randomCount}`, 'timeout': 10000}, (err, resp, data) => { |
| 361 | try { |
| 362 | if (err) { |
| 363 | console.log(`${JSON.stringify(err)}`) |
| 364 | console.log(`${$.name} API请求失败,请检查网路重试`) |
| 365 | } else { |
| 366 | if (data) { |
| 367 | console.log(`随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`) |
| 368 | data = JSON.parse(data); |
| 369 | } |
| 370 | } |
| 371 | } catch (e) { |
| 372 | $.logErr(e, resp) |
| 373 | } finally { |
| 374 | resolve(data); |
| 375 | } |
| 376 | }) |
| 377 | await $.wait(10000); |
| 378 | resolve() |
| 379 | }) |
| 380 | } |
| 381 | //提交互助码 |
| 382 | |
| 383 | function submitCode() { |
no test coverage detected