fixed: 修复文件分片上传在已选择文件的情况下,再次选择并取消出现控制台飘红且原文件清空的bug (#1746)

This commit is contained in:
nonstop
2024-05-18 11:48:28 +08:00
committed by GitHub
parent 0fba597a61
commit 42de9257c3

View File

@@ -83,6 +83,11 @@ const percentageFlage = ref(true)
// 选中文件的函数
const choseFile = async(e) => {
// 点击选择文件后取消 直接return
if (!e.target.files.length) {
return
}
const fileR = new FileReader() // 创建一个reader用来读取文件流
const fileInput = e.target.files[0] // 获取当前文件
const maxSize = 5 * 1024 * 1024