Commit 90d666b3 authored by 张冬's avatar 张冬

更新

parent 80e24305
......@@ -65,31 +65,11 @@ import {
const isLt100M =
file.size / 1024 / 1024 > 10 && file.size / 1024 / 1024 < 1024;
const isLt30 = file.name.length < 30;
if (["video/mp4"].indexOf(file.type) == -1) {
this.$message.error("请上传正确的视频格式");
return false;
}
if (!isLt100M) {
this.$message.error("上传视频大小要在10MB~1GB之间哦!");
return false;
}
if (!isLt30) {
this.$message.error("上传视频文件名称长度必须要小于30个文字哦!");
return false;
}
// 请求后台接口拿配置参数
return new Promise((resolve, reject) => {
getAliOSSConfig()
.then(response => {
this.dataObj = response.data; //接口返回配置参数
console.log(response.data);
resolve(true);
})
.catch(err => {
console.log(err);
reject(false);
});
});
},
// http-request属性来覆盖默认的上传行为(即action="url"),自定义上传的实现
Upload(file) {
......@@ -102,7 +82,7 @@ import {
fileNameLength
);
let fileName = getFileNameUUID() + "." + fileFormat;
client(that.dataObj)
client1(that.dataObj)
.multipartUpload(`videoTest/${fileName}`, file.file, {
progress: function(p) {
//p进度条的值
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment