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

Function queryAvailableSubsidyAmount

jd_jin_tie.js:345–392  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

343 })
344}
345function queryAvailableSubsidyAmount() {
346 const body = JSON.stringify({
347 channel: "sqcs",
348 "riskDeviceParam": JSON.stringify({
349 appId: "jdapp",
350 appType: "3",
351 clientVersion: "9.4.6",
352 deviceType: "iPhone11,8",
353 "eid": cookie,
354 "fp": getFp(),
355 idfa: "",
356 imei: "",
357 ip: "",
358 macAddress: "",
359 networkType: "WIFI",
360 os: "iOS",
361 osVersion: "14.2",
362 token: "",
363 uuid: ""
364 })
365 })
366 const options = taskUrl('queryAvailableSubsidyAmount', body, 'jrm');
367 return new Promise((resolve) => {
368 $.get(options, async (err, resp, data) => {
369 try {
370 if (err) {
371 console.log(`${JSON.stringify(err)}`)
372 console.log(`${$.name} API请求失败,请检查网路重试`)
373 } else {
374 data = JSON.parse(data);
375 if (data.resultCode === 0) {
376 if (data.resultData.code === '000') {
377 console.log(`获取当前总金贴成功\n\n京东账号${$.index} ${$.nickName || $.UserName} 当前总金贴:${data.resultData.data}元`)
378 } else {
379 console.log('获取当前总金贴失败', data.resultData.msg)
380 }
381 } else {
382 console.log('获取当前总金贴失败', data.resultMsg)
383 }
384 }
385 } catch (e) {
386 $.logErr(e, resp);
387 } finally {
388 resolve(data);
389 }
390 })
391 })
392}
393async function doTask() {
394 for (let task of $.willTask) {
395 console.log(`\n开始领取 【${task['name']}】任务`);

Callers 1

mainFunction · 0.85

Calls 5

getFpFunction · 0.85
taskUrlFunction · 0.70
getMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected