(function_id, body = {})
| 121 | }) |
| 122 | } |
| 123 | function taskUrl(function_id, body = {}) { |
| 124 | return { |
| 125 | url: `${JD_API_HOST}?functionId=${function_id}&body=${escape(JSON.stringify(body))}&client=wh5&clientVersion=1.0.0&_=${new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000}`, |
| 126 | headers: { |
| 127 | "Accept": "*/*", |
| 128 | "Accept-Encoding": "gzip, deflate, br", |
| 129 | "Accept-Language": "zh-cn", |
| 130 | "Connection": "keep-alive", |
| 131 | "Content-Type": "application/x-www-form-urlencoded", |
| 132 | "Host": "api.m.jd.com", |
| 133 | "Referer": "https://h5.m.jd.com/active/redrain/index.html", |
| 134 | "Cookie": cookie, |
| 135 | "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"), |
| 136 | } |
| 137 | } |
| 138 | } |
| 139 | function TotalBean() { |
| 140 | return new Promise(async resolve => { |
| 141 | const options = { |
no test coverage detected