Browse Source

buile——1

xvying 1 year ago
parent
commit
d8d4e59dbd
2 changed files with 8 additions and 8 deletions
  1. 0 0
      online/static/js/app.js
  2. 8 8
      src/utils/request.js

File diff suppressed because it is too large
+ 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(
 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

Some files were not shown because too many files changed in this diff