/* Submits files to the server */ submitFiles(){ /* Initialize the form data */ let formData = new FormData(); /* Iteate over any file sent over appending the files to the form data. */ for( var i = 0; i < this.files.length; i++ ){ let file = this.files[i]; formData.append('picture', file); formData.append('name',"测试课程"); formData.append('introduction',"这说vd"); } /* Make the request to the POST /select-files 羞涩的牛排/ this.$axios.post( '/teacher/createCourse', formData,{ headers: { 'Content-Type': 'multipart/form-data' }}, ).then(function(){ console.log('SUCCESS!!'); }) .catch(function(){ console.log('FAILURE!!'); }); },