()
| 346 | } |
| 347 | //提交互助码 |
| 348 | function submitCode() { |
| 349 | return new Promise(async resolve => { |
| 350 | $.get({url: `http://www.helpu.cf/jdcodes/submit.php?code=${myInviteCode}&type=sgmh`, timeout: 10000}, (err, resp, data) => { |
| 351 | try { |
| 352 | if (err) { |
| 353 | console.log(`${JSON.stringify(err)}`) |
| 354 | console.log(`${$.name} API请求失败,请检查网路重试`) |
| 355 | } else { |
| 356 | if (data) { |
| 357 | //console.log(`随机取个${randomCount}码放到您固定的互助码后面(不影响已有固定互助)`) |
| 358 | data = JSON.parse(data); |
| 359 | } |
| 360 | } |
| 361 | } catch (e) { |
| 362 | $.logErr(e, resp) |
| 363 | } finally { |
| 364 | resolve(data); |
| 365 | } |
| 366 | }) |
| 367 | await $.wait(15000); |
| 368 | resolve() |
| 369 | }) |
| 370 | } |
| 371 | function TotalBean() { |
| 372 | return new Promise(async resolve => { |
| 373 | const options = { |
no test coverage detected