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

Function getShareCode

jd_EsportsManager.js:129–157  ·  view source on GitHub ↗
(token)

Source from the content-addressed store, hash-verified

127}
128
129function getShareCode(token) {
130 return new Promise(resolve => {
131 $.get({
132 url: 'https://xinruidddj-isv.isvjcloud.com/api/uc/user',
133 headers: {
134 'Host': 'xinruidddj-isv.isvjcloud.com',
135 'Content-Type': 'application/x-www-form-urlencoded',
136 'Accept': 'application/json, text/plain, */*',
137 'Authorization': `Bearer ${$.token}`,
138 'User-Agent': $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;10.0.2;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1"),
139 'Accept-Language': 'zh-cn',
140 }
141 }, (err, resp, data) => {
142 try {
143 data = $.toObj(data)
144 shareCodes.push({
145 'tid': token,
146 'uid': data.body.openid
147 })
148 console.log(`\n【京东账号${$.index}(${$.UserName})的${$.name}好友互助码】${shareCodes[$.index - 1].uid}\n`);
149
150 } catch (e) {
151 $.logErr(e, resp)
152 } finally {
153 resolve();
154 }
155 })
156 })
157}
158
159function doAssist() {
160 return new Promise(resolve => {

Callers 1

mainFunction · 0.70

Calls 6

getMethod · 0.45
isNodeMethod · 0.45
getdataMethod · 0.45
toObjMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected