前端
this.formFileEl = document.getElementById('formFile')
if (this.formFileEl.files.length == 0) {
this.alertMessage('请选择一个文件!', 'danger');
return
}
let formData = new FormData();
formData.append('files', this.formFileEl.files[0]);
let url = '/import/license'
fetch(url, {
method: 'POST',
body: formData
})