diff --git a/epmet-oper-web/src/utils/request.js b/epmet-oper-web/src/utils/request.js index 02f19a5..7fe06f7 100644 --- a/epmet-oper-web/src/utils/request.js +++ b/epmet-oper-web/src/utils/request.js @@ -68,22 +68,22 @@ http.interceptors.response.use(response => { return Promise.reject(error) }) -// http.put = function (url, data, config) { -// http.post(url, data, { -// ...config, -// headers: { +http.put = function (url, data, config) { + http.post(url, data, { + ...config, + headers: { + "X-HTTP-Method-Override": "PUT", + }, + }); +}; -// }; -// "X-HTTP-Method-Override": "PUT", -// }, -// }); -// }; +http.delete = function (url, config) { + http.post(url, config.data || {}, { + ...config, + headers: { + "X-HTTP-Method-Override": "DELETE", + }, + }); +}; -// http.delete = function (url, config) { -// http.post(url, config.data || {}, { -// ...config, -// headers: { -// "X-HTTP-Method-Override": "DELETE", -// }, -// }); export default http