Forráskód Böngészése

improve: 请求头

From-wh 2 éve
szülő
commit
309a00969f

+ 7 - 7
template/admin/src/pages/system/backendRouting/debugging.vue

@@ -434,13 +434,13 @@ export default {
     },
     changeTab(name) {
       if (name === 'Header') {
-        if (!this.$refs.zTable.getTableData().tableData.length) {
-          this.insertEvent('zTable', {
-            attribute: 'Content-Type',
-            value: 'application/x-www-form-urlencoded',
-          });
-          this.insertEvent('zaTable');
-        }
+        // if (!this.$refs.zTable.getTableData().tableData.length) {
+        //   this.insertEvent('zTable', {
+        //     attribute: 'Content-Type',
+        //     value: 'application/x-www-form-urlencoded',
+        //   });
+        //   this.insertEvent('zaTable');
+        // }
       }
       console.log(this.interfaceData);
     },

+ 1 - 5
template/admin/src/pages/system/backendRouting/index.vue

@@ -508,11 +508,7 @@ export default {
         {
           value: 'PUT',
           label: 'PUT',
-        },
-        {
-          value: '*',
-          label: '*',
-        },
+        }
       ],
       contextData: null, //左侧导航右键点击是产生的数据对象
       treeData: undefined,

+ 2 - 0
template/admin/src/pages/system/backendRouting/request.js

@@ -20,6 +20,8 @@ service.interceptors.request.use(
     // }
     if (config.file) {
       config.headers['Content-Type'] = 'multipart/form-data';
+    } else {
+      config.headers['Content-Type'] = 'application/json;charset=UTF-8';
     }
     try {
       if (config.headerItem) {