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

Function getToken

jd_pk.js:683–714  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

681 });
682}
683function getToken() {
684 return new Promise((resolve) => {
685 let options = {
686 "url": "https://jdjoy.jd.com/saas/framework/user/token?appId=dafbe42d5bff9d82298e5230eb8c3f79&client=m&url=pengyougou.m.jd.com",
687 "headers": {
688 "Host": "jdjoy.jd.com",
689 "Origin": "https://prodev.m.jd.com",
690 "Cookie": cookie,
691 "Connection": "keep-alive",
692 "Accept": "application/json, text/plain, */*",
693 "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0"),
694 "Accept-Language": "zh-cn",
695 "Referer": "https://prodev.m.jd.com/mall/active/4HTqMAvser7ctEBEdhK4yA7fXpPi/index.html?babelChannel=ttt9&tttparams=AeOIMwdeyJnTG5nIjoiMTE3LjAyOTE1NyIsImdMYXQiOiIyNS4wOTUyMDcifQ7%3D%3D&lng=00.000000&lat=00.000000&sid=&un_area="
696 }
697 }
698 $.post(options, (err, resp, res) => {
699 try {
700 if (res) {
701 let data = JSON.parse(res);
702 if (data) {
703 $.token = data.data
704 }
705
706 }
707 } catch (e) {
708 console.log(e);
709 } finally {
710 resolve(res);
711 }
712 })
713 });
714}
715
716
717function safeGet(data) {

Callers 1

mainFunction · 0.70

Calls 4

isNodeMethod · 0.45
getdataMethod · 0.45
postMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected