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

Function safeGet

jd_blueCoin.js:457–467  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

455 })
456}
457function safeGet(data) {
458 try {
459 if (typeof JSON.parse(data) == "object") {
460 return true;
461 }
462 } catch (e) {
463 console.log(e);
464 console.log(`京东服务器访问数据为空,请检查自身设备网络情况`);
465 return false;
466 }
467}
468function taskUrl(function_id, body = {}) {
469 return {
470 url: `${JD_API_HOST}&functionId=${function_id}&clientVersion=8.0.0&client=m&body=${escape(JSON.stringify(body))}&t=${Date.now()}`,

Callers 4

smtg_materialPrizeIndexFunction · 0.70
smtg_queryPrizeFunction · 0.70
smtg_obtainPrizeFunction · 0.70
smtgHomeFunction · 0.70

Calls 1

logMethod · 0.45

Tested by

no test coverage detected