### 视频和图片上传并合成V0.0.1
~~~[api]
post:http://192.168.3.196/api/concatVideos
*multipart:video=视频#请上传.mp4格式视频,最好是压缩过的
*string:img=合成图片#要合并的图片,最好已经裁剪完成的,默认裁剪720*50
*string:zxuser=自定义用户标识(手机号||openid||用户名)#用户标识
string:others=其它参数#后续版本更新会增加更多功能参数
<<<
success
{'status':200,'url':$url}
<<<
error
{'status':404,'url':$message}
~~~
注释:
`$message` 后端提供错误信息(类型:字符串);
`$url` 图片存储地址
#### 上传实例:
~~~
<form enctype='multipart/form-data'>
<div>
<div id="loadImg" class="cnt-img-content">
<div id="licenseBox" class="ctn-licence">
<input type="file" id="ctn-input-img" name="image[]" accept="video/*" style="height:40px">
<br/>
<input type="file" id="ctn-input-video" name="image[]" accept="image/*" style="height:40px">
<input type="hidden" id="zxuser" name="zxuser" value="15267357511" style="height:40px">
</div>
</div>
</div>
<div>
<button id="infoLogoSaveBt" type="button">保存</button>
</div>
</form>
<script type="text/javascript" src="axios.min.js"></script>
<script type="text/javascript">
document.querySelector('#infoLogoSaveBt').onclick=function(){
let zx = document.querySelector('#zxuser').value;
let img = document.querySelector('#ctn-input-img').files[0];
let video = document.querySelector('#ctn-input-video').files[0];
var formData = new FormData();
formData.append("image[]", img);
formData.append("image[]",video);
formData.append("zxuser",zx);
axios({
headers: {'X-Requested-With': '这里就是加密数据'},
method: 'post',
url: $url,
data:formData
}).then(function(response) {
console.log(response);
}).catch(function(error){
console.log(error);
});
}
</script>
~~~