|
@@ -242,6 +242,10 @@ export default {
|
|
|
//上传视频
|
|
|
fileUpload(e) {
|
|
|
this.mediaFile = e.target.files[0]
|
|
|
+ if (!this.mediaFile.type.includes('video')) {
|
|
|
+ this.msgError('请选择视频文件')
|
|
|
+ return false
|
|
|
+ }
|
|
|
this.videoPercentage = 0
|
|
|
const uploader = this.tcVod.upload({
|
|
|
mediaFile: this.mediaFile // 媒体文件(视频或音频或图片),类型为 File
|
|
@@ -256,6 +260,10 @@ export default {
|
|
|
//上传封面
|
|
|
async coverUpload(e) {
|
|
|
this.coverFile = e.target.files[0]
|
|
|
+ if (!this.coverFile.type.includes('image')) {
|
|
|
+ this.msgError('请选择视频文件')
|
|
|
+ return false
|
|
|
+ }
|
|
|
this.imagePercentage = 0
|
|
|
let formData = new FormData()
|
|
|
formData.append('coverFile', this.coverFile)
|