vue-upload-component is used in the project to upload files, press demo to set pos-action, etc., but why is request-method options,? ask how to set it to post
<file-upload
:headers="{"Content-Type":"multipart/form-data"}"
post-action="http://192.168.121.24:1400/cmsWeb/api/crm/talk/upLoadFile"
put-action="http://192.168.121.24:1400/cmsWeb/api/crm/talk/upLoadFile"
class="btn btn-primary"
extensions="gif,jpg,jpeg,png,webp"
accept="image/png,image/gif,image/jpeg,image/webp"
:multiple="false"
:size="1024 * 1024 * 10"
v-model="files"
@input-filter="inputFilter"
@input-file="inputFile"
ref="upload">
<i class="fa fa-plus"></i>
Select files
</file-upload>
inputFilter(newFile, oldFile, prevent) {
if (newFile && !oldFile) {
// Before adding a file
//
// Filter system files or hide files
//
if (/(\/|^)(Thumbs\.db|desktop\.ini|\..+)$/.test(newFile.name)) {
return prevent()
}
// Filter php html js file
// php html js
if (/\.(php5?|html?|jsx?)$/i.test(newFile.name)) {
return prevent()
}
}
},
inputFile(newFile, oldFile) {
this.$refs.upload.active = true
if (newFile && !oldFile) {
// add
console.log("add", newFile)
}
if (newFile && oldFile) {
// update
console.log("update", newFile)
}
if (!newFile && oldFile) {
// remove
console.log("remove", oldFile)
}
}