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

Function do_task

jd_EsportsManager.js:343–378  ·  view source on GitHub ↗
(token, id, type)

Source from the content-addressed store, hash-verified

341}
342
343function do_task(token, id, type) {
344 return new Promise(resolve => {
345 // console.log(token, id, type)
346 $.post({
347 url: 'https://xinruidddj-isv.isvjcloud.com/api/task/do_task',
348 headers: {
349 'Host': 'xinruidddj-isv.isvjcloud.com',
350 'Accept': 'application/json, text/plain, */*',
351 'Authorization': `Bearer ${$.token}`,
352 'Accept-Language': 'zh-cn',
353 'Origin': 'https://xinruidddj-isv.isvjcloud.com',
354 'User-Agent': $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;10.0.2;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1"),
355 'Referer': 'https://xinruidddj-isv.isvjcloud.com/',
356 },
357 body: `token=${token}&task_id=${id}&task_type=${type}`
358 }, (err, resp, data) => {
359 try {
360 if (!err) {
361 data = JSON.parse(data)
362 if (data.status === '0') {
363 let result = data.body.result
364 console.log(`任务成功:本次获得 ${result.acquired_score},账户总额 ${result.user_score}`)
365 resolve(200);
366 } else {
367 console.log('任务失败!')
368 resolve(502)
369 }
370 }
371 } catch (e) {
372 $.logErr(e, resp)
373 } finally {
374 resolve()
375 }
376 })
377 })
378}
379
380function makeShareCode() {
381 return new Promise(resolve => {

Callers 1

mainFunction · 0.85

Calls 5

postMethod · 0.45
isNodeMethod · 0.45
getdataMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected