mirror of
https://gitee.com/xiangheng/x_admin.git
synced 2025-10-08 09:31:26 +08:00
统一上传文件不区分图片、视频接口,素材中心私有化
This commit is contained in:
@@ -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>
|
||||
|
||||
|
Reference in New Issue
Block a user