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

Function joinTask

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

Source from the content-addressed store, hash-verified

298}
299
300function joinTask(task) {
301 return new Promise(resolve => {
302 $nobyda.get('https://tc.vip.iqiyi.com/taskCenter/task/joinTask?taskCode=' + task.taskCode + '&lang=zh_CN&platform=0000000000000000&P00001=' + P00001, function (error, response, data) {
303 let joinTaskMsg, Details = LogDetails ? `msg:\n${data || error}` : '';
304 try {
305 if (error) throw new Error(`请求失败`);
306 const obj = JSON.parse(data);
307 joinTaskMsg = obj.code || '领取失败';
308 } catch (e) {
309 joinTaskMsg = `错误 ${e.message || e}`;
310 }
311 console.log(`爱奇艺-领取任务: ${task.name} => ${joinTaskMsg} ${Details}`)
312 resolve()
313 })
314 })
315}
316
317function notifyTask(task) {
318 return new Promise(resolve => {

Callers 1

iQIYI.jsFile · 0.85

Calls 2

getMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected