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

Function getTaskList

jd_jxnc.js:343–371  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

341
342// 获取任务列表与用户信息
343function getTaskList() {
344 return new Promise(async resolve => {
345 $.get(taskUrl('query', `type=1`), async (err, resp, data) => {
346 try {
347 let res = data.match(/try\{whyour\(([\s\S]*)\)\;\}catch\(e\)\{\}/);
348 if (res) {
349 res = res[1];
350 const {detail, msg, task = [], retmsg, ...other} = JSON.parse(res);
351 $.detail = detail;
352 $.helpTask = task.filter(x => x.tasktype === 2)[0] || {eachtimeget: 0, limit: 0};
353 $.allTask = task.filter(x => x.tasktype !== 3 && x.tasktype !== 2 && parseInt(x.left) > 0);
354 $.info = other;
355 $.log(`获取任务列表 ${retmsg} 总共${$.allTask.length}个任务!`);
356 if (!$.info.active) {
357 $.log('账号未选择种子,请先去京喜农场选择种子。\n如果选择 APP 专属种子,必须提供 token。');
358 message += '账号未选择种子,请先去京喜农场选择种子。\n如果选择 APP 专属种子,必须提供 token。\n';
359 notifyBool = notifyBool && notifyLevel >= 3;
360 resolve(false);
361 }
362 resolve(other);
363 }
364 } catch (e) {
365 $.logErr(e, resp);
366 } finally {
367 resolve(true);
368 }
369 });
370 });
371}
372
373function browserTask() {
374 return new Promise(async resolve => {

Callers 1

jdJXNCFunction · 0.70

Calls 4

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

Tested by

no test coverage detected