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

Function takePostRequest

jd_summer_movement.js:313–390  ·  view source on GitHub ↗
(type)

Source from the content-addressed store, hash-verified

311}
312
313async function takePostRequest(type) {
314 let body = ``;
315 let myRequest = ``;
316 switch (type) {
317 case 'olympicgames_home':
318 body = `functionId=olympicgames_home&body={}&client=wh5&clientVersion=1.0.0&uuid=${uuid}&appid=o2_act`;
319 myRequest = await getPostRequest(body);
320 break;
321 case 'olympicgames_receiveCash':
322 body = `functionId=olympicgames_receiveCash&body={"type":6}&client=wh5&clientVersion=1.0.0&uuid=${uuid}&appid=o2_act`;
323 myRequest = await getPostRequest(body);
324 break
325 case 'olympicgames_getTaskDetail':
326 body = `functionId=olympicgames_getTaskDetail&body={"taskId":"","appSign":"1"}&client=wh5&clientVersion=1.0.0&uuid=${uuid}&appid=o2_act`;
327 myRequest = await getPostRequest(body);
328 break
329 case 'olympicgames_doTaskDetail':
330 body = await getPostBody(type);
331 myRequest = await getPostRequest(body);
332 break;
333 case 'olympicgames_getFeedDetail':
334 body = `functionId=olympicgames_getFeedDetail&body={"taskId":"${$.taskId}"}&client=wh5&clientVersion=1.0.0&uuid=${uuid}&appid=o2_act`;
335 myRequest = await getPostRequest(body);
336 break;
337 case 'wxTaskDetail':
338 body = `functionId=olympicgames_getTaskDetail&body={"taskId":"","appSign":"2"}&client=wh5&clientVersion=1.0.0&uuid=${uuid}&appid=o2_act`;
339 myRequest = await getPostRequest(body);
340 break
341 case 'olympicgames_collectCurrency':
342 body = await getPostBody(type);
343 myRequest = await getPostRequest(body);
344 break
345 case 'add_car':
346 body = await getPostBody(type);
347 myRequest = await getPostRequest(body);
348 break;
349 case 'help':
350 case 'byHelp':
351 body = await getPostBody(type);
352 myRequest = await getPostRequest( body);
353 break;
354 case 'olympicgames_startTraining':
355 body = await getPostBody(type);
356 myRequest = await getPostRequest( body);
357 break;
358 case 'olypicgames_guradHome':
359 body = `functionId=olypicgames_guradHome&body={}&client=wh5&clientVersion=1.0.0&uuid=${uuid}&appid=o2_act`;
360 myRequest = await getPostRequest( body);
361 break
362 case 'olympicgames_tiroGuide':
363 body = `functionId=olympicgames_tiroGuide&body={"sex":1,"sportsGoal":2}&client=wh5&clientVersion=1.0.0&uuid=${uuid}&appid=${$.appid}`;
364 myRequest = await getPostRequest(body);
365 break;
366 default:
367 console.log(`错误${type}`);
368 }
369 if( type === 'add_car' ){
370 myRequest['url'] = `https://api.m.jd.com/client.action?advId=olympicgames_doTaskDetail`;

Callers 3

mainFunction · 0.70
doTaskFunction · 0.70

Calls 6

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

Tested by

no test coverage detected