(urlPath, method, params, timestamp, token = "")
| 86 | } |
| 87 | |
| 88 | function makeSign(urlPath, method, params, timestamp, token = "") { |
| 89 | let payload = ""; |
| 90 | if (params) { |
| 91 | payload = method === "POST" ? JSON.stringify(params) : stringifyQuery(params); |
| 92 | } |
| 93 | return md5(`${API_BASE}${urlPath}${timestamp}${payload}${APP_KEY}${token || ""}`); |
| 94 | } |
| 95 | |
| 96 | async function apiRequest(method, urlPath, { token = "", params = null } = {}) { |
| 97 | const timestamp = String(Date.now()); |
no test coverage detected