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

Function takePostRequest

activity/jd_party_night.js:111–145  ·  view source on GitHub ↗
(type)

Source from the content-addressed store, hash-verified

109}
110
111async function takePostRequest(type) {
112 let body = ``;
113 let myRequest = ``;
114 switch (type) {
115 case 'partyTonight_init':
116 body = `functionId=partyTonight_init&body={}&client=wh5&clientVersion=1.0.0&uuid=`;
117 myRequest = getPostRequest(`partyTonight_init`, body);
118 break;
119 case 'partyTonight_remind':
120 body = `functionId=partyTonight_remind&body={}&client=wh5&clientVersion=1.0.0&uuid=`;
121 myRequest = getPostRequest(`partyTonight_remind`, body);
122 break;
123 case 'partyTonight_assist':
124 body = `functionId=partyTonight_assist&body={"inviteCode":"${$.inviteCode}"}&client=wh5&clientVersion=1.0.0&uuid=`;
125 myRequest = getPostRequest(`partyTonight_assist`, body);
126 break;
127 case 'partyTonight_lottery':
128 body = `functionId=partyTonight_lottery&body={}&client=wh5&clientVersion=1.0.0&uuid=`;
129 myRequest = getPostRequest(`partyTonight_lottery`, body);
130 break;
131 default:
132 console.log(`错误${type}`);
133 }
134 return new Promise(async resolve => {
135 $.post(myRequest, (err, resp, data) => {
136 try {
137 dealReturn(type, data);
138 } catch (e) {
139 $.logErr(e, resp)
140 } finally {
141 resolve();
142 }
143 })
144 })
145}
146
147function dealReturn(type, data) {
148 try {

Callers 1

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