(options)
| 65 | } |
| 66 | |
| 67 | async function request(options) { |
| 68 | const res = await axios.request({ |
| 69 | timeout: 25000, |
| 70 | validateStatus: () => true, |
| 71 | ...options, |
| 72 | headers: { |
| 73 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 MicroMessenger MiniProgramEnv/Windows", |
| 74 | Accept: "application/json, text/plain, */*", |
| 75 | ...(options.headers || {}), |
| 76 | }, |
| 77 | }); |
| 78 | return { status: res.status, data: res.data, headers: res.headers || {} }; |
| 79 | } |
| 80 | |
| 81 | async function getWxCode(openid) { |
| 82 | if (!WX_AUTH) throw new Error("未配置 wx_auth,无法从 wx_server 获取 code"); |
no test coverage detected