mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-student.git
synced 2025-12-11 11:56:48 +08:00
fix:作业限制视频文件格式上传
This commit is contained in:
@@ -51,19 +51,26 @@ function handleChange(file) {
|
|||||||
f.uid = file.uid;
|
f.uid = file.uid;
|
||||||
file.raw = f;
|
file.raw = f;
|
||||||
console.log(file.raw)
|
console.log(file.raw)
|
||||||
imageRef.value.submit();
|
if(file.raw.name.includes('.mp4') || file.raw.name.includes('.jpeg')){
|
||||||
|
files.value = []
|
||||||
|
emit('update:value', files.value)
|
||||||
|
ElMessage.error(`暂不支持此格式文件上传`);
|
||||||
|
return
|
||||||
|
}else{
|
||||||
|
imageRef.value.submit();
|
||||||
|
|
||||||
if (file.response && file.response.code === 200) {
|
if (file.response && file.response.code === 200) {
|
||||||
file.url = file.response.data
|
file.url = file.response.data
|
||||||
}
|
}
|
||||||
const index = files.value.findIndex(f => f.uid === file.uid)
|
const index = files.value.findIndex(f => f.uid === file.uid)
|
||||||
if (index === -1) {
|
if (index === -1) {
|
||||||
files.value.unshift(file)
|
files.value.unshift(file)
|
||||||
} else {
|
} else {
|
||||||
files.value[index] = file
|
files.value[index] = file
|
||||||
}
|
}
|
||||||
|
|
||||||
emit('update:value', files.value)
|
emit('update:value', files.value)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function remove(i) {
|
function remove(i) {
|
||||||
|
|||||||
Reference in New Issue
Block a user