(url, data = {}, options = {}, requiresAuth = true, responseType = 'json')
| 171 | * @returns {Promise} - 请求结果 |
| 172 | */ |
| 173 | export function apiPost(url, data = {}, options = {}, requiresAuth = true, responseType = 'json') { |
| 174 | return apiRequest( |
| 175 | url, |
| 176 | { |
| 177 | method: 'POST', |
| 178 | body: data instanceof FormData ? data : JSON.stringify(data), |
| 179 | ...options |
| 180 | }, |
| 181 | requiresAuth, |
| 182 | responseType |
| 183 | ) |
| 184 | } |
| 185 | |
| 186 | export function apiAdminPost(url, data = {}, options = {}, responseType = 'json') { |
| 187 | checkAdminPermission() |
no test coverage detected