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

Function request

jd_moneyTree.js:784–807  ·  view source on GitHub ↗
(function_id, body = {})

Source from the content-addressed store, hash-verified

782
783
784async function request(function_id, body = {}) {
785 await $.wait(1000); //歇口气儿, 不然会报操作频繁
786 return new Promise((resolve, reject) => {
787 $.post(taskurl(function_id, body), (err, resp, data) => {
788 try {
789 if (err) {
790 console.log("\n摇钱树京东API请求失败 ‼️‼️");
791 console.log(JSON.stringify(err));
792 $.logErr(err);
793 } else {
794 if (data) {
795 data = JSON.parse(data);
796 } else {
797 console.log(`京豆api返回数据为空,请检查自身原因`)
798 }
799 }
800 } catch (eor) {
801 $.msg("摇钱树-初始化个人信息" + eor.name + "‼️", JSON.stringify(eor), eor.message)
802 } finally {
803 resolve(data)
804 }
805 })
806 })
807}
808
809function taskurl(function_id, body) {
810 return {

Callers 11

dayWorkFunction · 0.70
harvestFunction · 0.70
sellFunction · 0.70
myWealthFunction · 0.70
signFunction · 0.70
signIndexFunction · 0.70
signOneFunction · 0.70
getSignAwardFunction · 0.70
setUserLinkStatusFunction · 0.70
receiveAwardFunction · 0.70
shareFunction · 0.70

Calls 6

taskurlFunction · 0.70
waitMethod · 0.45
postMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45
msgMethod · 0.45

Tested by

no test coverage detected