()
| 1373 | } |
| 1374 | |
| 1375 | function readShareCodePk() { |
| 1376 | console.log(`开始`) |
| 1377 | return new Promise(async resolve => { |
| 1378 | $.get({ |
| 1379 | url: `http://jd.turinglabs.net/api/v2/jd/nian/read/${randomCount}/`, |
| 1380 | 'timeout': 10000 |
| 1381 | }, (err, resp, data) => { |
| 1382 | try { |
| 1383 | if (err) { |
| 1384 | console.log(`${JSON.stringify(err)}`) |
| 1385 | console.log(`${$.name} API请求失败,请检查网路重试`) |
| 1386 | } else { |
| 1387 | if (data) { |
| 1388 | console.log(`随机取${randomCount}个PK助力码放到您固定的互助码后面(不影响已有固定互助)`) |
| 1389 | data = JSON.parse(data); |
| 1390 | } |
| 1391 | } |
| 1392 | } catch (e) { |
| 1393 | $.logErr(e, resp) |
| 1394 | } finally { |
| 1395 | resolve(data); |
| 1396 | } |
| 1397 | }) |
| 1398 | await $.wait(10000); |
| 1399 | resolve() |
| 1400 | }) |
| 1401 | } |
| 1402 | |
| 1403 | //格式化助力码 |
| 1404 | function shareCodesFormat() { |
no test coverage detected