MCPcopy Index your code
hub / github.com/NobyDa/Script / getTaskList

Function getTaskList

iQIYI-DailyBonus/iQIYI.js:269–298  ·  view source on GitHub ↗
(task)

Source from the content-addressed store, hash-verified

267}
268
269function getTaskList(task) {
270 return new Promise(resolve => {
271 $nobyda.get(`https://tc.vip.iqiyi.com/taskCenter/task/queryUserTask?P00001=${P00001}`, function (error, response, data) {
272 let taskListMsg, taskList = [];
273 const Details = LogDetails ? `msg:\n${data || error}` : '';
274 try {
275 if (error) throw new Error(`请求失败`);
276 const obj = JSON.parse(data);
277 if (obj.code == 'A00000' && obj.data && obj.data.tasks) {
278 Object.keys(obj.data.tasks).map((group) => {
279 (obj.data.tasks[group] || []).map((item) => {
280 taskList.push({
281 name: item.taskTitle,
282 taskCode: item.taskCode,
283 status: item.status
284 })
285 })
286 })
287 taskListMsg = `获取成功!`;
288 } else {
289 taskListMsg = `获取失败!`;
290 }
291 } catch (e) {
292 taskListMsg = `${e.message || e} ‼️`;
293 }
294 console.log(`爱奇艺-任务列表: ${taskListMsg} ${Details}`)
295 resolve(taskList)
296 })
297 })
298}
299
300function joinTask(task) {
301 return new Promise(resolve => {

Callers 1

iQIYI.jsFile · 0.85

Calls 2

getMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected