(options)
| 69 | } |
| 70 | |
| 71 | async function request(options) { |
| 72 | const res = await axios.request({ |
| 73 | timeout: 20000, |
| 74 | validateStatus: () => true, |
| 75 | ...options, |
| 76 | headers: { |
| 77 | "User-Agent": USER_AGENT, |
| 78 | Accept: "application/json, text/plain, */*", |
| 79 | ...(options.headers || {}), |
| 80 | }, |
| 81 | }); |
| 82 | return { status: res.status, headers: res.headers || {}, data: res.data }; |
| 83 | } |
| 84 | |
| 85 | async function getWxCode(openid) { |
| 86 | if (!WX_AUTH) throw new Error("未配置 wx_auth"); |