MCPcopy Create free account
hub / github.com/Toulu-debug/enen / getFarmShareCode

Function getFarmShareCode

TS_USER_AGENTS.ts:72–87  ·  view source on GitHub ↗
(cookie: string)

Source from the content-addressed store, hash-verified

70}
71
72async 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`, {
74 headers: {
75 "cookie": cookie,
76 "origin": "https://home.m.jd.com",
77 "referer": "https://home.m.jd.com/myJd/newhome.action",
78 "User-Agent": USER_AGENT,
79 "Content-Type": "application/x-www-form-urlencoded"
80 }
81 })
82
83 if (data.farmUserPro)
84 return data.farmUserPro.shareCode
85 else
86 return ''
87}
88
89async function getCookie(): Promise<string[]> {
90 let cookiesArr: string[] = []

Callers

nothing calls this directly

Calls 1

postMethod · 0.45

Tested by

no test coverage detected