MCPcopy Create free account
hub / github.com/smallfawn/QLScriptPublic / httpRequest

Function httpRequest

xiaosatonglu.js:415–439  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

413
414/////////////////////////////////////////////////////////////////////////////////////
415function httpRequest(options) {
416 if (!options["method"]) {
417 return console.log(`请求方法不存在`);
418 }
419 if (!options["fn"]) {
420 console.log(`函数名不存在`);
421 }
422 return new Promise((resolve) => {
423 $[options.method](options, (err, resp, data) => {
424 try {
425 if (err) {
426 $.logErr(err);
427 } else {
428 try {
429 resp = JSON.parse(resp);
430 } catch (error) { }
431 }
432 } catch (e) {
433 $.logErr(e, resp);
434 } finally {
435 resolve(resp);
436 }
437 });
438 });
439}
440async function SendMsg(message) {
441 if (!message) return;
442 if ($.isNode()) {

Callers 9

getCodeMethod · 0.70
loginMethod · 0.70
user_infoMethod · 0.70
read_statusMethod · 0.70
read_taskMethod · 0.70
lottery_numMethod · 0.70
lottery_taskMethod · 0.70
art_listMethod · 0.70
do_readMethod · 0.70

Calls 2

logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected