()
| 1345 | } |
| 1346 | |
| 1347 | function readShareCode() { |
| 1348 | console.log(`开始`) |
| 1349 | return new Promise(async resolve => { |
| 1350 | $.get({ |
| 1351 | url: `https://code.chiang.fun/api/v1/jd/jdnian/read/${randomCount}/`, |
| 1352 | 'timeout': 10000 |
| 1353 | }, (err, resp, data) => { |
| 1354 | try { |
| 1355 | if (err) { |
| 1356 | console.log(`${JSON.stringify(err)}`) |
| 1357 | console.log(`${$.name} API请求失败,请检查网路重试`) |
| 1358 | } else { |
| 1359 | if (data) { |
| 1360 | console.log(`随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`) |
| 1361 | data = JSON.parse(data); |
| 1362 | } |
| 1363 | } |
| 1364 | } catch (e) { |
| 1365 | $.logErr(e, resp) |
| 1366 | } finally { |
| 1367 | resolve(data); |
| 1368 | } |
| 1369 | }) |
| 1370 | await $.wait(10000); |
| 1371 | resolve() |
| 1372 | }) |
| 1373 | } |
| 1374 | |
| 1375 | function readShareCodePk() { |
| 1376 | console.log(`开始`) |
no test coverage detected