MCPcopy Create free account
hub / github.com/chavyleung/scripts / drawprize_ans

Function drawprize_ans

wanda/wanda.js:193–216  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

191
192// 答题后抽奖
193function drawprize_ans() {
194 return new Promise((resolve) => {
195 const drawprizeVal = getKey()['key']+'/question/prize/lottery.apiactivityCode='+$.questionCode
196 mx_api['ts'] = getKey()['ts']
197 mx_api['check'] = hex_md5(drawprizeVal)
198 const url = {
199 url:'https://activity-api-mx.wandafilm.com/question/prize/lottery.api',
200 headers:{
201 'MX-API':JSON.stringify(mx_api),
202 },
203 body : 'activityCode='+$.questionCode
204 }
205 $.post(url, (err, resp, data) => {
206 try {
207 const res = JSON.parse(data)
208 $.desc.push(`答题抽奖:${res.data.prize.prizeName}`)
209 } catch (e) {
210 $.logErr(e, resp)
211 } finally {
212 resolve()
213 }
214 })
215 })
216}
217
218function showmsg() {
219 return new Promise((resolve) => {

Callers

nothing calls this directly

Calls 4

getKeyFunction · 0.85
hex_md5Function · 0.85
postMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected