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

Function helpInviteFriend

jd_joy_run.js:383–420  ·  view source on GitHub ↗
(friendPin)

Source from the content-addressed store, hash-verified

381 })
382}
383function helpInviteFriend(friendPin) {
384 return new Promise((resolve) => {
385 headers.Cookie = cookie;
386 headers.LKYLToken = $.LKYLToken;
387 let opt = {
388 // url: "//jdjoy.jd.com/common/pet/getPetTaskConfig?reqSource=h5",
389 url: `//draw.jdfcloud.com/common/pet/helpFriend?friendPin=${encodeURI(friendPin)}&reqSource=h5&invokeKey=qRKHmL4sna8ZOP9F`,
390 method: "GET",
391 data: {},
392 credentials: "include",
393 header: {"content-type": "application/json"}
394 }
395 const url = "https:"+ taroRequest(opt)['url'] + $.validate;
396 const options = {
397 url,
398 headers
399 }
400 $.get(options, (err, resp, data) => {
401 try {
402 if (err) {
403 $.log('API请求失败')
404 $.logErr(JSON.stringify(err));
405 } else {
406 $.log(`邀请助力结果:${data}`);
407 data = JSON.parse(data);
408 // {"errorCode":"help_ok","errorMessage":null,"currentTime":1600254297789,"data":29466,"success":true}
409 if (data.success && data.errorCode === 'help_ok') {
410 $.inviteReward += 30;
411 }
412 }
413 } catch (e) {
414 $.logErr(e, resp)
415 } finally {
416 resolve(data);
417 }
418 });
419 })
420}
421//赛跑助力
422async function run(run_pins) {
423 console.log(`账号${$.index} [${UserName}] 给下面名单的人进行赛跑助力\n${(run_pins.map(item => item.trim()))}\n`);

Callers 1

inviteFunction · 0.85

Calls 4

taroRequestFunction · 0.70
getMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected