媒体库增加文件上传类型
This commit is contained in:
parent
350913c2fb
commit
b1b60bc309
|
|
@ -30,6 +30,7 @@ const uploadData = ref({
|
|||
category: props.category
|
||||
})
|
||||
const beforeUpload = (file) => {
|
||||
console.log('file.type', file.type)
|
||||
const isDocument = isDocumentMime(file.type)
|
||||
const isZip = isZipMime(file.type)
|
||||
const isLt500K = file.size / 1024 / 1024 < 0.5 // 500K, @todo 应支持在项目中设置
|
||||
|
|
@ -39,7 +40,7 @@ const beforeUpload = (file) => {
|
|||
const isImage = isImageMime(file.type)
|
||||
|
||||
if (!isVideo && !isImage && !isDocument && !isZip) {
|
||||
ElMessage.error('上传图片只能是 jpg,png,svg,webp 格式, 上传视频只能是 mp4,webm 格式,上传文件只能是 txt,pdf,doc,docx,xls,xlsx,ppt,pptx,zip,rar!')
|
||||
ElMessage.error('上传图片只能是 jpg,png,svg,webp 格式, 上传视频只能是 mp4,webm 格式,上传文件只能是 txt,pdf,doc,docx,xls,xlsx,ppt,pptx,wps,et,dps,zip,rar!')
|
||||
return false
|
||||
}
|
||||
if (isDocument && !isLt20M) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue