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

Function queryTask

jd_mcxhd.js:139–169  ·  view source on GitHub ↗
(taskToken)

Source from the content-addressed store, hash-verified

137 })
138}
139function queryTask(taskToken){
140 return new Promise(resolve => {
141 $.get({
142 url: `https://api.m.jd.com/?client=wh5&clientVersion=1.0.0&functionId=queryVkComponent&body={%22businessId%22:%22chanyedai%22,%22componentId%22:%22f6e2c64666f54b46868496f290f181e6%22,%22taskParam%22:%22%257B%2522taskToken%2522%3A%2522${taskToken}%2522%257D%22}&_timestamp=${+new Date()}`,
143 headers: {
144 'Host': 'api.m.jd.com',
145 'Origin': 'https://h5.m.jd.com',
146 'Accept': '*/*',
147 'User-Agent': 'jdapp;iPhone;10.0.2;14.5.1;appBuild/167688;jdSupportDarkMode/0;Mozilla/5.0 (iPhone; CPU iPhone OS 14_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
148 'Accept-Language': 'zh-cn',
149 'Referer': 'https://h5.m.jd.com/babelDiy/Zeus/3fHfkJDWEckhqH73tRgUgxmg8U9S/index.html',
150 Cookie: cookie
151 }
152 }, async (err, resp, data) => {
153 try {
154 if (err) {
155 console.log(`${JSON.stringify(err)}`)
156 console.log(`${$.name} API请求失败,请检查网路重试`)
157 } else {
158 if (safeGet(data)) {
159 data = JSON.parse(data);
160 }
161 }
162 } catch (e) {
163 $.logErr(e, resp)
164 } finally {
165 resolve();
166 }
167 })
168 })
169}
170function viewTask(taskToken){
171 const body = {
172 "dataSource": "newshortAward",

Callers 1

doTaskFunction · 0.70

Calls 4

safeGetFunction · 0.70
getMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected