| 1266 | } |
| 1267 | |
| 1268 | function JingDongGetCash(s) { |
| 1269 | merge.JDGetCash = {}; |
| 1270 | return new Promise(resolve => { |
| 1271 | if (disable("JDGetCash")) return resolve() |
| 1272 | setTimeout(() => { |
| 1273 | const GetCashUrl = { |
| 1274 | url: 'https://api.m.jd.com/client.action?functionId=cash_sign&body=%7B%22remind%22%3A0%2C%22inviteCode%22%3A%22%22%2C%22type%22%3A0%2C%22breakReward%22%3A0%7D&client=apple&clientVersion=9.0.8&openudid=1fce88cd05c42fe2b054e846f11bdf33f016d676&sign=7e2f8bcec13978a691567257af4fdce9&st=1596954745073&sv=111', |
| 1275 | headers: { |
| 1276 | Cookie: KEY, |
| 1277 | } |
| 1278 | }; |
| 1279 | $nobyda.get(GetCashUrl, function(error, response, data) { |
| 1280 | try { |
| 1281 | if (error) { |
| 1282 | throw new Error(error) |
| 1283 | } else { |
| 1284 | const cc = JSON.parse(data); |
| 1285 | const Details = LogDetails ? "response:\n" + data : ''; |
| 1286 | if (cc.data.success && cc.data.result) { |
| 1287 | console.log("\n" + "京东商城-现金签到成功 " + Details) |
| 1288 | merge.JDGetCash.success = 1 |
| 1289 | merge.JDGetCash.Money = cc.data.result.signCash || 0 |
| 1290 | merge.JDGetCash.notify = `京东商城-现金: 成功, 明细: ${cc.data.result.signCash||`无`}现金 💰` |
| 1291 | } else { |
| 1292 | console.log("\n" + "京东商城-现金签到失败 " + Details) |
| 1293 | merge.JDGetCash.fail = 1 |
| 1294 | if (data.match(/\"bizCode\":201|已经签过/)) { |
| 1295 | merge.JDGetCash.notify = "京东商城-现金: 失败, 原因: 已签过 ⚠️" |
| 1296 | } else if (data.match(/\"code\":300|退出登录/)) { |
| 1297 | merge.JDGetCash.notify = "京东商城-现金: 失败, 原因: Cookie失效‼️" |
| 1298 | } else { |
| 1299 | merge.JDGetCash.notify = "京东商城-现金: 失败, 原因: 未知 ⚠️" |
| 1300 | } |
| 1301 | } |
| 1302 | } |
| 1303 | } catch (eor) { |
| 1304 | $nobyda.AnError("京东商城-现金", "JDGetCash", eor, response, data) |
| 1305 | } finally { |
| 1306 | resolve() |
| 1307 | } |
| 1308 | }) |
| 1309 | }, s) |
| 1310 | if (out) setTimeout(resolve, out + s) |
| 1311 | }); |
| 1312 | } |
| 1313 | |
| 1314 | function JingDongStore(s) { |
| 1315 | merge.JDGStore = {}; |