(res, action)
| 105 | } |
| 106 | |
| 107 | function assertOk(res, action) { |
| 108 | if (!res || !okCode(res)) { |
| 109 | throw new Error(`${action}失败: ${res?.message || res?.msg || res?.errMsg || shortJson(res, 500)}`); |
| 110 | } |
| 111 | return res.data; |
| 112 | } |
| 113 | |
| 114 | async function request(method, base, urlPath, { token = "", data = null, params = null } = {}) { |
| 115 | const res = await axios({ |
no test coverage detected