原生input上传视拼,参数形式 file: (binary)形式的

<input type="file" @change="demo">

if(e.target.files[0]&&e.target.files[0].type.indexOf("mp4")!=-1){//检查视频
	console.log("e",e.target.files[0].type);//这个就是binary流

        //接口
	fileUpload({
	// 转换为
	file: e.target.files[0]
	}).then(res=>{
		if( res.success==true){
			// console.log(res);
			this.getterVideohttp(res.data);
			this.videoPass=res.data;
		}
	})
}else{
	this.$notify({
		message: "请上传video/mp4",
		type: 'success',
		duration: 1500
	})
	return
}

posted @ 2020-08-19 11:13  何人陪我共长生  阅读(5863)  评论(0编辑  收藏  举报