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

Function dotask

jd_wxFans.js:351–373  ·  view source on GitHub ↗
(id, body)

Source from the content-addressed store, hash-verified

349
350// 做任务
351function dotask(id, body) {
352 return new Promise(resolve => {
353 $.post(taskPostUrl(`/wxFansInterActionActivity/${id}`, `activityId=${$.actid}&uuid=${$.uuid}${body?body:""}`), async (err, resp, data) => {
354 try {
355 if (err) {
356 console.log(`${$.name} API请求失败,请检查网路重试`)
357 } else {
358 let info = JSON.parse(data)
359 if(info&&info.result){
360 console.log(` 操作结果:${info.result}`)
361 if(id =="startDraw"){
362 if(info.data.drawOk){console.log(` 抽奖成功,活动 ${info.data.drawInfo.name}`)}else{console.log(JSON.stringify(info))}
363 }
364 }
365 }
366 } catch (e) {
367 $.logErr(e, resp)
368 } finally {
369 resolve(data);
370 }
371 })
372 })
373}
374
375
376function taskUrl(url, body) {

Callers 2

jd_wxFans.jsFile · 0.70
getaskFunction · 0.70

Calls 4

taskPostUrlFunction · 0.70
postMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected