浏览代码

buile——1

xvying 1 年之前
父节点
当前提交
d8d4e59dbd
共有 2 个文件被更改,包括 8 次插入8 次删除
  1. 0 0
      online/static/js/app.js
  2. 8 8
      src/utils/request.js

文件差异内容过多而无法显示
+ 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

部分文件因为文件数量过多而无法显示