MCPcopy Create free account
hub / github.com/Semporia/Scripts / submitCode

Function submitCode

jd_pet.js:485–507  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

483}
484//提交互助码
485function submitCode() {
486 return new Promise(async resolve => {
487 $.get({url: `http://www.helpu.cf/jdcodes/submit.php?code=${$.petInfo.shareCode}&type=pet`, timeout: 10000}, (err, resp, data) => {
488 try {
489 if (err) {
490 console.log(`${JSON.stringify(err)}`)
491 console.log(`${$.name} submitCode API请求失败,请检查网路重试`)
492 } else {
493 if (data) {
494 //console.log(`随机取个${randomCount}码放到您固定的互助码后面(不影响已有固定互助)`)
495 data = JSON.parse(data);
496 }
497 }
498 } catch (e) {
499 $.logErr(e, resp)
500 } finally {
501 resolve(data);
502 }
503 })
504 await $.wait(15000);
505 resolve()
506 })
507}
508function shareCodesFormat() {
509 return new Promise(async resolve => {
510 // console.log(`第${$.index}个京东账号的助力码:::${$.shareCodesArr[$.index - 1]}`)

Callers 1

jdPetFunction · 0.70

Calls 4

getMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45
waitMethod · 0.45

Tested by

no test coverage detected