更新于 08-09 12:16

This commit is contained in:
root
2021-08-09 12:16:21 -04:00
parent 7f807cca34
commit 34541bc603
12 changed files with 5363 additions and 86 deletions

25
utils/JDHelpers.js Executable file
View File

@@ -0,0 +1,25 @@
function safeGet(data) {
try {
if (typeof JSON.parse(data) == "object") {
return true;
}
} catch (e) {
console.log(e);
console.log(`京东服务器访问数据为空,请检查自身设备网络情况`);
return false;
}
}
function jsonParse(str) {
if (typeof str == "string") {
try {
return JSON.parse(str);
} catch (e) {
console.log(e);
$.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie')
return [];
}
}
}
exports.safeGet = safeGet;
exports.jsonParse = jsonParse;