An error was reported when uploading pictures on vue.

axios({
      method: "post",
      url: "http://193.112.56.202:8001/api/upload/imageData",
      headers: {
        "Access-Control-Allow-Origin": "*",
        "Content-Type": "application/x-www-form-urlencoded"
      },
      params: {
        imgFile1: rst.base64
      }
    }).then((res) => {
      this.peopleImg = res.data.fileNames[0]
    })
    

I use post to upload base64 images. Why is base64 stitched to url after the upload is successful? This leads to sometimes requests that are too long and fail. What is the reason? Trouble boss to answer, wait online

clipboard.png

May.12,2021

axios({
      method: 'post',
      url: 'http://193.112.56.202:8001/api/upload/imageData',
      headers: {
        'Access-Control-Allow-Origin': '*',
        'Content-Type': 'application/x-www-form-urlencoded'
      },
      data: { //postdatagetparams
        imgFile1: rst.base64
      }
    }).then((res) => {
      this.peopleImg = res.data.fileNames[0]
    })
Menu