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

Function getTaskInfo

jd_crazy_joy.js:235–261  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

233}
234
235function getTaskInfo() {
236 let body = {"paramData": {"taskType": "DAY_TASK"}}
237 return new Promise(async resolve => {
238 $.get(taskUrl('crazyJoy_task_getTaskState', JSON.stringify(body)), async (err, resp, data) => {
239 try {
240 $.taskList = []
241 if (err) {
242 console.log(`${JSON.stringify(err)}`)
243 console.log(`${$.name} API请求失败,请检查网路重试`)
244 } else {
245 if (safeGet(data)) {
246 data = JSON.parse(data);
247 if (data.success && data.data && data.data.length) {
248 $.taskList = data.data;
249 } else {
250 console.log(`任务信息获取失败`)
251 }
252 }
253 }
254 } catch (e) {
255 $.logErr(e, resp)
256 } finally {
257 resolve();
258 }
259 })
260 })
261}
262
263function doSign() {
264 return new Promise(async resolve => {

Callers 1

doTasksFunction · 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