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

Function getReward

jd_cash.js:261–287  ·  view source on GitHub ↗
(source = 1)

Source from the content-addressed store, hash-verified

259 })
260}
261function getReward(source = 1) {
262 return new Promise((resolve) => {
263 $.get(taskUrl("cash_mob_reward",{"source": Number(source),"rewardNode":""}), (err, resp, data) => {
264 try {
265 if (err) {
266 console.log(`${JSON.stringify(err)}`)
267 console.log(`${$.name} API请求失败,请检查网路重试`)
268 } else {
269 if (safeGet(data)) {
270 data = JSON.parse(data);
271 if (data.code === 0 && data.data.bizCode === 0) {
272 console.log(`领奖成功,${data.data.result.shareRewardTip}【${data.data.result.shareRewardAmount}】`)
273 message += `领奖成功,${data.data.result.shareRewardTip}【${data.data.result.shareRewardAmount}元】\n`;
274 // console.log(data.data.result.taskInfos)
275 } else {
276 // console.log(`领奖失败,${data.data.bizMsg}`)
277 }
278 }
279 }
280 } catch (e) {
281 $.logErr(e, resp)
282 } finally {
283 resolve(data);
284 }
285 })
286 })
287}
288function exchange2(node) {
289 let body = '';
290 const data = {node,"configVersion":"1.0"}

Callers 1

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