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

Function takePostRequest

jd_star_shop.js:544–590  ·  view source on GitHub ↗
(type)

Source from the content-addressed store, hash-verified

542}
543
544async function takePostRequest(type) {
545 let body = ``;
546 let myRequest = ``;
547 switch (type) {
548 case 'activityStarBackGetProgressBarInfo':
549 body = `functionId=activityStarBackGetProgressBarInfo&body={"starId":"${$.uniqueId}","linkId":"Y2aqxng42hZ0eGxGtbCMiQ"}&_t=${Date.now()}&appid=activities_platform`;
550 myRequest = getPostRequest(body);
551 break;
552 case 'apTaskList':
553 body = `functionId=apTaskList&body={"uniqueId":"${$.uniqueId}","linkId":"Y2aqxng42hZ0eGxGtbCMiQ"}&_t=${Date.now()}&appid=activities_platform`;
554 myRequest = getPostRequest(body);
555 break;
556 case 'SIGN':
557 body = `functionId=apDoTask&body={"taskType":"${$.oneTask.taskType}","taskId":${$.oneTask.id},"uniqueId":"${$.uniqueId}","linkId":"Y2aqxng42hZ0eGxGtbCMiQ"}&_t=${Date.now()}&appid=activities_platform`;
558 myRequest = getPostRequest(body);
559 break;
560 case 'apTaskDetail':
561 body = `functionId=apTaskDetail&body={"taskType":"${$.oneTask.taskType}","taskId":${$.oneTask.id},"uniqueId":"${$.uniqueId}","channel":4,"linkId":"Y2aqxng42hZ0eGxGtbCMiQ"}&_t=${Date.now()}&appid=activities_platform`;
562 myRequest = getPostRequest(body);
563 break;
564 case 'apDoTask':
565 body = `functionId=apDoTask&body={"taskType":"${$.oneTask.taskType}","taskId":${$.oneTask.id},"uniqueId":"${$.uniqueId}","channel":4,"linkId":"Y2aqxng42hZ0eGxGtbCMiQ","itemId":"${encodeURIComponent($.oneItemInfo.itemId)}"}&_t=${Date.now()}&appid=activities_platform`;
566 myRequest = getPostRequest(body);
567 break;
568 case 'help':
569 body = `functionId=activityStarBackGetProgressBarInfo&body={"starId":"${$.uniqueId}","sharePin":"${$.oneCode}","taskId":"129","linkId":"Y2aqxng42hZ0eGxGtbCMiQ"}&_t=${Date.now()}&appid=activities_platform`;
570 myRequest = getPostRequest(body);
571 break;
572 case 'activityStarBackDrawPrize':
573 body = `functionId=activityStarBackDrawPrize&body={"starId":"${$.uniqueId}","poolId":${$.onePrize.id},"pos":${$.onePrize.pos},"linkId":"Y2aqxng42hZ0eGxGtbCMiQ"}&_t=${Date.now()}&appid=activities_platform`;
574 myRequest = getPostRequest(body);
575 break;
576 default:
577 console.log(`错误${type}`);
578 }
579 return new Promise(async resolve => {
580 $.post(myRequest, (err, resp, data) => {
581 try {
582 dealReturn(type, data);
583 } catch (e) {
584 $.logErr(e, resp)
585 } finally {
586 resolve();
587 }
588 })
589 })
590}
591
592function dealReturn(type, data) {
593 try {

Callers 2

jd_star_shop.jsFile · 0.70
starShopFunction · 0.70

Calls 5

getPostRequestFunction · 0.70
dealReturnFunction · 0.70
logMethod · 0.45
postMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected