| 51 | let USER_AGENT = USER_AGENTS_ARR[getRandomNumberByRange(0, USER_AGENTS_ARR.length)] |
| 52 | |
| 53 | async function getBeanShareCode(cookie: string) { |
| 54 | let {data}: any = await axios.post('https://api.m.jd.com/client.action', |
| 55 | `functionId=plantBeanIndex&body=${encodeURIComponent( |
| 56 | JSON.stringify({version: "9.0.0.1", "monitor_source": "plant_app_plant_index", "monitor_refer": ""}) |
| 57 | )}&appid=ld&client=apple&area=5_274_49707_49973&build=167283&clientVersion=9.1.0`, { |
| 58 | headers: { |
| 59 | Cookie: cookie, |
| 60 | Host: "api.m.jd.com", |
| 61 | Accept: "*/*", |
| 62 | Connection: "keep-alive", |
| 63 | "User-Agent": USER_AGENT |
| 64 | } |
| 65 | }) |
| 66 | if (data.data?.jwordShareInfo?.shareUrl) |
| 67 | return data.data.jwordShareInfo.shareUrl.split('Uuid=')![1] |
| 68 | else |
| 69 | return '' |
| 70 | } |
| 71 | |
| 72 | async function getFarmShareCode(cookie: string) { |
| 73 | let {data}: any = await axios.post('https://api.m.jd.com/client.action?functionId=initForFarm', `body=${encodeURIComponent(JSON.stringify({"version": 4}))}&appid=wh5&clientVersion=9.1.0`, { |