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

Function getTaskList

activity/jd_nian_wechat.js:228–250  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

226}
227
228function getTaskList() {
229 return new Promise(resolve => {
230 $.get(taskUrl("nian_getTaskDetail", {"appSign":"2","channel":1}), async (err, resp, data) => {
231 try {
232 if (err) {
233 console.log(`${JSON.stringify(err)}`)
234 console.log(`${$.name} API请求失败,请检查网路重试`)
235 } else {
236 if (safeGet(data)) {
237 data = JSON.parse(data);
238 if (data.data.bizCode === 0) {
239 $.taskVos = data.data.result.taskVos;//任务列表
240 }
241 }
242 }
243 } catch (e) {
244 $.logErr(e, resp)
245 } finally {
246 resolve();
247 }
248 })
249 })
250}
251
252function taskUrl(function_id, body = {}) {
253 let url = `${JD_API_HOST}`;

Callers 1

jdNianFunction · 0.70

Calls 5

taskUrlFunction · 0.70
safeGetFunction · 0.70
getMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected