失败案例
async uploadFileHandler(e) {
if (e.target.files.length) {
const files = e.target.files[0];
let formData = new FormData();
formData.append("file", files);
formData.append("module", "knowledge");
fileupload(formData).then(res => {
if (res.data.code == 0) {
console.log(res, "resres");
}
e.target.value = "";
});
getVideoInfoHandler(files).then(res => {
console.log(res, "视频信息");
});
}
}
成功案例
async uploadFileHandler(e) {
if (e.target.files.length) {
const files = e.target.files[0];
let formData = new FormData();
formData.append("file", files);
formData.append("module", "knowledge");
fileupload(formData).then(res => {
if (res.data.code == 0) {
console.log(res, "resres");
}
e.target.value = "";
});
getVideoInfoHandler(files).then(res => {
console.log(res, "视频信息");
});
}
}