| 1338 | } |
| 1339 | //提交互助码 |
| 1340 | function submitCode() { |
| 1341 | return new Promise(async resolve => { |
| 1342 | $.get({url: `http://www.helpu.cf/jdcodes/submit.php?code=${myInviteCode}&type=jxfactory`, timeout: 10000}, (err, resp, data) => { |
| 1343 | try { |
| 1344 | if (err) { |
| 1345 | console.log(`${JSON.stringify(err)}`) |
| 1346 | console.log(`${$.name} API请求失败,请检查网路重试`) |
| 1347 | } else { |
| 1348 | if (data) { |
| 1349 | //console.log(`随机取个${randomCount}码放到您固定的互助码后面(不影响已有固定互助)`) |
| 1350 | data = JSON.parse(data); |
| 1351 | } |
| 1352 | } |
| 1353 | } catch (e) { |
| 1354 | $.logErr(e, resp) |
| 1355 | } finally { |
| 1356 | resolve(data); |
| 1357 | } |
| 1358 | }) |
| 1359 | await $.wait(15000); |
| 1360 | resolve() |
| 1361 | }) |
| 1362 | } |
| 1363 | //格式化助力码 |
| 1364 | function shareCodesFormat() { |
| 1365 | return new Promise(async resolve => { |