统一上传文件不区分图片、视频接口,素材中心私有化

This commit is contained in:
xh
2025-08-27 03:17:40 +08:00
parent a58c1360d7
commit 606bcbef0a
17 changed files with 296 additions and 213 deletions

View File

@@ -28,12 +28,25 @@ export default defineComponent({
default: '100px'
},
// 文件类型
type: {
ext: {
type: String,
default: 'image'
default: ''
}
},
emits: ['close']
emits: ['close'],
computed: {
type() {
const imageExt = ['jpg', 'jpeg', 'png', 'gif', 'bmp']
const videoExt = ['mp4', 'avi', 'mov']
if (imageExt.includes(this.ext)) {
return 'image'
}
if (videoExt.includes(this.ext)) {
return 'video'
}
return 'file'
}
}
})
</script>