| 1312 | } |
| 1313 | |
| 1314 | function JingDongStore(s) { |
| 1315 | merge.JDGStore = {}; |
| 1316 | return new Promise(resolve => { |
| 1317 | if (disable("JDGStore")) return resolve() |
| 1318 | setTimeout(() => { |
| 1319 | $nobyda.get({ |
| 1320 | url: 'https://api.m.jd.com/api?appid=jdsupermarket&functionId=smtg_sign&clientVersion=8.0.0&client=m&body=%7B%7D', |
| 1321 | headers: { |
| 1322 | Cookie: KEY, |
| 1323 | Origin: `https://jdsupermarket.jd.com` |
| 1324 | } |
| 1325 | }, (error, response, data) => { |
| 1326 | try { |
| 1327 | if (error) throw new Error(error); |
| 1328 | const cc = JSON.parse(data); |
| 1329 | const Details = LogDetails ? "response:\n" + data : ''; |
| 1330 | if (cc.data && cc.data.success === true && cc.data.bizCode === 0) { |
| 1331 | console.log(`\n京东商城-超市签到成功 ${Details}`) |
| 1332 | merge.JDGStore.success = 1 |
| 1333 | merge.JDGStore.bean = cc.data.result.jdBeanCount || 0 |
| 1334 | merge.JDGStore.notify = `京东商城-超市: 成功, 明细: ${merge.JDGStore.bean||`无`}京豆 🐶` |
| 1335 | } else { |
| 1336 | if (!cc.data) cc.data = {} |
| 1337 | console.log(`\n京东商城-超市签到失败 ${Details}`) |
| 1338 | const tp = cc.data.bizCode == 811 ? `已签过` : cc.data.bizCode == 300 ? `Cookie失效` : `${cc.data.bizMsg||`未知`}` |
| 1339 | merge.JDGStore.notify = `京东商城-超市: 失败, 原因: ${tp}${cc.data.bizCode==300?`‼️`:` ⚠️`}` |
| 1340 | merge.JDGStore.fail = 1 |
| 1341 | } |
| 1342 | } catch (eor) { |
| 1343 | $nobyda.AnError("京东商城-超市", "JDGStore", eor, response, data) |
| 1344 | } finally { |
| 1345 | resolve() |
| 1346 | } |
| 1347 | }) |
| 1348 | }, s) |
| 1349 | if (out) setTimeout(resolve, out + s) |
| 1350 | }); |
| 1351 | } |
| 1352 | |
| 1353 | function JDSecKilling(s) { //领券中心 |
| 1354 | merge.JDSecKill = {}; |