(method, base, urlPath, { token = "", data = null, params = null } = {})
| 112 | } |
| 113 | |
| 114 | async function request(method, base, urlPath, { token = "", data = null, params = null } = {}) { |
| 115 | const res = await axios({ |
| 116 | method, |
| 117 | url: `${base}${urlPath}`, |
| 118 | data, |
| 119 | params, |
| 120 | timeout: 20000, |
| 121 | validateStatus: () => true, |
| 122 | headers: headers(token), |
| 123 | }); |
| 124 | return res.data; |
| 125 | } |
| 126 | |
| 127 | function aesCbcPkcs7Hex(text, key, iv) { |
| 128 | const keyBuf = Buffer.from(String(key), "utf8"); |
no test coverage detected