Ver Fonte

buile——1

xvying há 1 ano atrás
pai
commit
d8d4e59dbd
2 ficheiros alterados com 8 adições e 8 exclusões
  1. 0 0
      online/static/js/app.js
  2. 8 8
      src/utils/request.js

Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
online/static/js/app.js


+ 8 - 8
src/utils/request.js

@@ -22,14 +22,14 @@ const service = axios.create({
 service.interceptors.request.use(
   (config) => {
     // 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) {
       // let each request carry token
       // ['X-Token'] is a custom headers key

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff