(urlPath, params = {}, token = "")
| 68 | } |
| 69 | |
| 70 | async function appletPost(urlPath, params = {}, token = "") { |
| 71 | const body = { |
| 72 | ...params, |
| 73 | deviceType: "4", |
| 74 | channel: "wxxcx", |
| 75 | }; |
| 76 | if (token) body.token = token; |
| 77 | body.sign = makeSign(body); |
| 78 | |
| 79 | const { data } = await axios.post(`${APPLET_BASE}${urlPath}`, new URLSearchParams(body).toString(), { |
| 80 | headers: { |
| 81 | "Content-Type": "application/x-www-form-urlencoded", |
| 82 | Referer: `https://servicewechat.com/${MINI_APP_ID}/52/page-frame.html`, |
| 83 | "User-Agent": "Mozilla/5.0 MicroMessenger MiniProgramEnv/Windows", |
| 84 | }, |
| 85 | timeout: 15000, |
| 86 | validateStatus: () => true, |
| 87 | }); |
| 88 | return data; |
| 89 | } |
| 90 | |
| 91 | class Task { |
| 92 | constructor(account) { |
no test coverage detected