()
| 332 | } |
| 333 | |
| 334 | function readShareCode() { |
| 335 | console.log(`开始`) |
| 336 | return new Promise(async resolve => { |
| 337 | $.get({ |
| 338 | url: `https://code.chiang.fun/api/v1/jd/year/read/${randomCount}/`, |
| 339 | 'timeout': 10000 |
| 340 | }, (err, resp, data) => { |
| 341 | try { |
| 342 | if (err) { |
| 343 | console.log(`${JSON.stringify(err)}`) |
| 344 | console.log(`${$.name} API请求失败,请检查网路重试`) |
| 345 | } else { |
| 346 | if (data) { |
| 347 | console.log(`随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`) |
| 348 | data = JSON.parse(data); |
| 349 | } |
| 350 | } |
| 351 | } catch (e) { |
| 352 | $.logErr(e, resp) |
| 353 | } finally { |
| 354 | resolve(data); |
| 355 | } |
| 356 | }) |
| 357 | await $.wait(2000); |
| 358 | resolve() |
| 359 | }) |
| 360 | } |
| 361 | function sendCard(cardNo) { |
| 362 | return new Promise((resolve) => { |
| 363 | $.post(taskPostUrl('newyearmoney_sendCard', {"cardNo": cardNo}), async (err, resp, data) => { |
no test coverage detected