wenbobowen 4 年之前
父節點
當前提交
421b12b476
共有 1 個文件被更改,包括 6 次插入5 次删除
  1. 6 5
      src/components/input/normalArea.vue

+ 6 - 5
src/components/input/normalArea.vue

@@ -147,10 +147,10 @@ export default {
     },
     uploadImg(imgData) {
       const config = {
-        // headers: {
-        //   'Content-Type': 'multipart/form-data'
-        // },
-        // withCredentials: true
+        headers: {
+          'Content-Type': 'application/json'
+        },
+        withCredentials: true
       } // 添加请求头
       return new Promise((resolve, reject) => {
         axios.post(
@@ -158,7 +158,8 @@ export default {
           {
             imgData,
             'innerPublic': true
-          }
+          },
+          config
         ).then(res => {
           console.log(res)
           // newStr = newStr.replace(imgData, res.url)