(options)
| 45 | } |
| 46 | |
| 47 | async function request(options) { |
| 48 | const res = await axios.request({ |
| 49 | timeout: 20000, |
| 50 | validateStatus: () => true, |
| 51 | ...options, |
| 52 | headers: { |
| 53 | "User-Agent": USER_AGENT, |
| 54 | Accept: "application/json, text/plain, */*", |
| 55 | ...(options.headers || {}), |
| 56 | }, |
| 57 | }); |
| 58 | return { status: res.status, headers: res.headers || {}, data: res.data }; |
| 59 | } |
| 60 | |
| 61 | async function getWxCode(appid, openid) { |
| 62 | if (!WX_AUTH) throw new Error("未配置 wx_auth"); |