|
|
@ -71,4 +71,23 @@ http.interceptors.response.use(response => { |
|
|
|
return Promise.reject(error) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
http.put = function (url, data, config) { |
|
|
|
http.post(url, data, { |
|
|
|
...config, |
|
|
|
headers: { |
|
|
|
"X-HTTP-Method-Override": "PUT", |
|
|
|
}, |
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
|
http.delete = function (url, config) { |
|
|
|
http.post(url, config.data || {}, { |
|
|
|
...config, |
|
|
|
headers: { |
|
|
|
"X-HTTP-Method-Override": "DELETE", |
|
|
|
}, |
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
|
export default http |
|
|
|