| 93 | } |
| 94 | |
| 95 | async function request(options) { |
| 96 | const res = await axios.request({ |
| 97 | timeout: 20000, |
| 98 | validateStatus: () => true, |
| 99 | ...options, |
| 100 | headers: { |
| 101 | "User-Agent": USER_AGENT, |
| 102 | Accept: "application/json, text/plain, */*", |
| 103 | Referer: `https://servicewechat.com/${APP.appid}/${APP.version}/page-frame.html`, |
| 104 | ...(options.headers || {}), |
| 105 | }, |
| 106 | }); |
| 107 | return { status: res.status, headers: res.headers || {}, data: res.data }; |
| 108 | } |
| 109 | |
| 110 | async function getWxCode(openid) { |
| 111 | if (!WX_AUTH) throw new Error("未配置 wx_auth,无法从 wx_server 获取 code"); |