(type)
| 175 | } |
| 176 | |
| 177 | async 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 | |
| 220 | async function dealReturn(type, res) { |
no test coverage detected