wenbobowen 4 years ago
parent
commit
421b12b476
1 changed files with 6 additions and 5 deletions
  1. 6 5
      src/components/input/normalArea.vue

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

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