(functionId, body = {})
| 120 | } |
| 121 | |
| 122 | function taskPostUrl(functionId, body = {}) { |
| 123 | return { |
| 124 | url: `${JD_API_HOST}?functionId=${functionId}`, |
| 125 | body: `functionId=${functionId}&body=${JSON.stringify(body)}&client=wh5&clientVersion=1.0.0`, |
| 126 | headers: { |
| 127 | '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"), |
| 128 | 'Content-Type': 'application/x-www-form-urlencoded', |
| 129 | 'Host': 'api.m.jd.com', |
| 130 | 'Cookie': cookie, |
| 131 | 'Origin': 'https://wbbny.m.jd.com', |
| 132 | 'Referer': 'https://wbbny.m.jd.com/babelDiy/Zeus/2s7hhSTbhMgxpGoa9JDnbDzJTaBB/index.html', |
| 133 | } |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | function jsonParse(str) { |
| 138 | if (typeof str == "string") { |
no test coverage detected