(function_id, body)
| 215 | }) |
| 216 | } |
| 217 | function taskUrl(function_id, body) { |
| 218 | return { |
| 219 | url: `${JD_API_HOST}/${function_id}`, |
| 220 | body: `reqData=${encodeURIComponent(JSON.stringify(body))}`, |
| 221 | headers: { |
| 222 | 'Accept' : `application/json`, |
| 223 | 'Origin' : `https://uua.jr.jd.com`, |
| 224 | 'Accept-Encoding' : `gzip, deflate, br`, |
| 225 | 'Cookie' : cookie, |
| 226 | 'Content-Type' : `application/x-www-form-urlencoded;charset=UTF-8`, |
| 227 | 'Host' : `ms.jr.jd.com`, |
| 228 | 'Connection' : `keep-alive`, |
| 229 | '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.4.4;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"), |
| 230 | 'Referer' : `https://uua.jr.jd.com/uc-fe-wxgrowing/moneytree/index`, |
| 231 | 'Accept-Language' : `zh-cn` |
| 232 | } |
| 233 | } |
| 234 | } |
| 235 | function jsonParse(str) { |
| 236 | if (typeof str == "string") { |
| 237 | try { |
no test coverage detected