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

Function getTaskList

jd_get_share_code.js:302–325  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

300async function getJdZZ() {
301 const JDZZ_API_HOST = "https://api.m.jd.com/client.action";
302 function getTaskList() {
303 return new Promise(resolve => {
304 $.get(taskZZUrl("interactTaskIndex"), async (err, resp, data) => {
305 try {
306 if (err) {
307 console.log(`${JSON.stringify(err)}`)
308 console.log(`${$.name} API请求失败,请检查网路重试`)
309 } else {
310 if (safeGet(data)) {
311 data = JSON.parse(data);
312 $.taskList = data.data.taskDetailResList;
313 if ($.taskList.filter(item => !!item && item['taskId']=== 3) && $.taskList.filter(item => !!item && item['taskId']=== 3).length) {
314 console.log(`【京东账号${$.index}(${$.UserName})的京东赚赚好友互助码】${$.taskList.filter(item => !!item && item['taskId']=== 3)[0]['itemId']}`);
315 }
316 }
317 }
318 } catch (e) {
319 $.logErr(e, resp)
320 } finally {
321 resolve(data);
322 }
323 })
324 })
325 }
326
327 function taskZZUrl(functionId, body = {}) {
328 return {

Callers 1

getJdZZFunction · 0.70

Calls 5

taskZZUrlFunction · 0.85
safeGetFunction · 0.70
getMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected