(options)
| 55 | } |
| 56 | |
| 57 | async function request(options) { |
| 58 | const res = await axios.request({ |
| 59 | timeout: 20000, |
| 60 | validateStatus: () => true, |
| 61 | ...options, |
| 62 | headers: { |
| 63 | "User-Agent": USER_AGENT, |
| 64 | Accept: "application/json, text/plain, */*", |
| 65 | ...(options.headers || {}), |
| 66 | }, |
| 67 | }); |
| 68 | return { status: res.status, headers: res.headers || {}, data: res.data }; |
| 69 | } |
| 70 | |
| 71 | async function getWxCode(appid, openid) { |
| 72 | if (!WX_AUTH) throw new Error("未配置 wx_auth"); |