ElementUI-upload upload file can not connect to the background interface?

elementUI-upload upload file cannot connect to background interface

<el-upload
  class="upload-demo"
  ref="upload"
  :action="uploadUrl"
  :limit="1"
  :on-exceed="handleExceed"
  :on-remove="handleRemove"
  :on-success="handleSuccess"
  :file-list="fileList"
  :auto-upload="false">
  <el-button slot="trigger" size="small" type="primary" ></el-button>
</el-upload>

configure URL
uploadUrl: this.$http.adornUrl ("/ appartifact/addAppArtifactVersion") in data

upload files manually

  dataFormSubmit () {
    this.$refs.upload.submit();
  }

Click to upload the network parameters
clipboard.png

clipboard.png

I don"t know why, solve

-split line-

replace it with the pre-upload hook: before-upload= "beforeUpload" to write, so you can use the background interface.

<el-upload
  class="upload-demo"
  ref="upload"
  action=""
  :before-upload="beforeUpload"
  :limit="1"
  :on-exceed="handleExceed"
  :on-success="handleSuccess"
  :auto-upload="false">
  <el-button slot="trigger" size="small" type="primary" ></el-button>
</el-upload>
Jan.23,2022

clipboard.png
uploadUrl is an address, not a request. Check to see if it is written wrong

Menu