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

Function takePostRequest

jd_summer_movement_help.js:177–217  ·  view source on GitHub ↗
(type)

Source from the content-addressed store, hash-verified

175}
176
177async function takePostRequest(type) {
178 let body = ``;
179 let myRequest = ``;
180 switch (type) {
181 case 'olympicgames_home':
182 body = `functionId=olympicgames_home&body={}&client=wh5&clientVersion=1.0.0&appid=${$.appid}`;
183 myRequest = await getPostRequest(`olympicgames_home`, body);
184 break;
185 case 'olympicgames_receiveCash':
186 let id = 6
187 if ($.Shend) id = 4
188 body = `functionId=olympicgames_receiveCash&body={"type":${id}}&client=wh5&clientVersion=1.0.0&appid=${$.appid}`;
189 myRequest = await getPostRequest(`olympicgames_receiveCash`, body);
190 break
191 case 'olypicgames_guradHome':
192 body = `functionId=olypicgames_guradHome&body={}&client=wh5&clientVersion=1.0.0&appid=${$.appid}`;
193 myRequest = await getPostRequest(`olypicgames_guradHome`, body);
194 break
195 case 'shHelp':
196 case 'help':
197 body = await getPostBody(type);
198 myRequest = await getPostRequest(`zoo_collectScore`, body);
199 break;
200 default:
201 console.log(`错误${type}`);
202 }
203 if (myRequest) {
204 return new Promise(async resolve => {
205 $.post(myRequest, (err, resp, data) => {
206 try {
207 // console.log(data);
208 dealReturn(type, data);
209 } catch (e) {
210 $.logErr(e, resp)
211 } finally {
212 resolve();
213 }
214 })
215 })
216 }
217}
218
219
220async function dealReturn(type, res) {

Callers 2

movementFunction · 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