|
@@ -22,14 +22,14 @@ const service = axios.create({
|
|
service.interceptors.request.use(
|
|
service.interceptors.request.use(
|
|
(config) => {
|
|
(config) => {
|
|
// do something before request is sent
|
|
// do something before request is sent
|
|
- // if (config.method.toUpperCase() == "PUT") {
|
|
|
|
- // config.method = "POST";
|
|
|
|
- // config.headers["X-HTTP-Method-Override"] = "PUT";
|
|
|
|
- // }
|
|
|
|
- // if (config.method.toUpperCase() == "DELETE") {
|
|
|
|
- // config.method = "POST";
|
|
|
|
- // config.headers["X-HTTP-Method-Override"] = "DELETE";
|
|
|
|
- // }
|
|
|
|
|
|
+ if (config.method.toUpperCase() == "PUT") {
|
|
|
|
+ config.method = "POST";
|
|
|
|
+ config.headers["X-HTTP-Method-Override"] = "PUT";
|
|
|
|
+ }
|
|
|
|
+ if (config.method.toUpperCase() == "DELETE") {
|
|
|
|
+ config.method = "POST";
|
|
|
|
+ config.headers["X-HTTP-Method-Override"] = "DELETE";
|
|
|
|
+ }
|
|
if (store.getters.token) {
|
|
if (store.getters.token) {
|
|
// let each request carry token
|
|
// let each request carry token
|
|
// ['X-Token'] is a custom headers key
|
|
// ['X-Token'] is a custom headers key
|