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