| 77 | })() |
| 78 | |
| 79 | async function api(fn: string, body: object) { |
| 80 | let {data}: any = await axios.post(`https://api.m.jd.com/client.action?functionId=${fn}`, |
| 81 | `body=${encodeURIComponent(JSON.stringify(body))}&appid=ld&client=apple&clientVersion=10.0.8&uuid=${uuid}&openudid=${uuid}`, { |
| 82 | headers: { |
| 83 | 'Host': 'api.m.jd.com', |
| 84 | 'content-type': 'application/x-www-form-urlencoded', |
| 85 | 'referer': '', |
| 86 | 'user-agent': 'JD4iPhone/167863%20(iPhone;%20iOS;%20Scale/3.00)', |
| 87 | 'Cookie': cookie |
| 88 | } |
| 89 | }) |
| 90 | return data |
| 91 | } |