(options)
| 88 | } |
| 89 | |
| 90 | async function request(options) { |
| 91 | const res = await axios.request({ |
| 92 | timeout: 20000, |
| 93 | validateStatus: () => true, |
| 94 | ...options, |
| 95 | headers: { |
| 96 | "User-Agent": USER_AGENT, |
| 97 | Accept: "application/json, text/plain, */*", |
| 98 | ...(options.headers || {}), |
| 99 | }, |
| 100 | }); |
| 101 | return { status: res.status, headers: res.headers || {}, data: res.data }; |
| 102 | } |
| 103 | |
| 104 | async function getWxCode(openid) { |
| 105 | if (!WX_AUTH) throw new Error("未配置 wx_auth,无法从 wx_server 获取 code"); |