element on-error attribute for upload component err returns string instead of the full response object

6kkfgxo0  于 2022-10-23  发布在  其他
关注(0)|答案(3)|浏览(163)

How can i get the error response if upload fails?
currently it get the error respond and convert it to string, how can i get the originally error respond object?

ElementUI upload component
<el-upload
            class="upload-demo"
            ref="upload"
            action="http://localhost:8000/api/files"
            :headers="headers"
            :auto-upload="false"
            :on-success="handleUploadSuccess"
            :on-error="handleUploadError"
>

handleUploadError(err, file){
      console.log(err); //its a string of the server respond instead of the respond object
}
wmomyfyw

wmomyfyw1#

I have the same question. What should I do

oug3syen

oug3syen2#

handleError(error, file, fileList) {
            const errors = JSON.parse(error.message)
zaq34kh6

zaq34kh63#

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

相关问题