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

Function getTaskRewards

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

Source from the content-addressed store, hash-verified

332}
333
334function getTaskRewards(task) {
335 return new Promise(resolve => {
336 $nobyda.get('https://tc.vip.iqiyi.com/taskCenter/task/getTaskRewards?taskCode=' + task.taskCode + '&lang=zh_CN&platform=0000000000000000&P00001=' + P00001, function (error, response, data) {
337 let RewardsMsg;
338 const Details = LogDetails ? `msg:\n${data || error}` : ''
339 try {
340 if (error) throw new Error(`接口请求出错 ‼️`);
341 const obj = JSON.parse(data)
342 if (obj.msg === "成功" && obj.code === "A00000" && obj.dataNew[0] !== undefined) {
343 RewardsMsg = `任务奖励: ${task.name} => ${obj.dataNew[0].name + obj.dataNew[0].value} 🎉`
344 } else {
345 RewardsMsg = `任务奖励: ${task.name} => ${obj.msg !== `成功` && obj.msg || `未完成`} ⚠️`
346 }
347 } catch (e) {
348 RewardsMsg = `任务奖励: ${e.message || e}`;
349 }
350 pushMsg.push(RewardsMsg)
351 console.log(`爱奇艺-${RewardsMsg} ${Details}`)
352 resolve()
353 })
354 })
355}
356
357function GetCookie() {
358 if (!$request.url.includes("iqiyi.com")) {

Callers 1

iQIYI.jsFile · 0.85

Calls 2

getMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected