Commit bd1f729f authored by 乐宝呗666's avatar 乐宝呗666

修改视频上传大小限制

parent 71a8cad5
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
<img src="@/assets/images/applets/tip.png" alt /> <img src="@/assets/images/applets/tip.png" alt />
<span> <span>
最多支持上传 最多支持上传
<b>3</b> 段视频,每段大小不能超过 <b>5MB</b> <b>3</b> 段视频,每段大小不能超过 <b>10MB</b>
</span> </span>
</div> </div>
</div> </div>
...@@ -202,12 +202,12 @@ export default { ...@@ -202,12 +202,12 @@ export default {
beforeVideo(file) { beforeVideo(file) {
let isOver = true let isOver = true
if(Array.isArray(file)){ if(Array.isArray(file)){
isOver = file.every(item=>item <= 5*1024*1024) isOver = file.every(item=>item <= 10*1024*1024)
}else{ }else{
isOver = file.size <= 5*1024*1024 isOver = file.size <= 10*1024*1024
} }
if(!isOver){ if(!isOver){
this.$toast.fail("上传文件大小不能超过 5MB"); this.$toast.fail("上传文件大小不能超过 10MB");
return false return false
}else{ }else{
return true return true
...@@ -307,6 +307,7 @@ export default { ...@@ -307,6 +307,7 @@ export default {
) )
.then((res) => { .then((res) => {
if(res.data.resultCode==='200'){ if(res.data.resultCode==='200'){
this.$toast('上传成功')
res.data.data.fileList.forEach(item=>{ res.data.data.fileList.forEach(item=>{
this.form.images.push(item.fileUrl); this.form.images.push(item.fileUrl);
this.imageIds.push(item.id); this.imageIds.push(item.id);
...@@ -351,12 +352,11 @@ export default { ...@@ -351,12 +352,11 @@ export default {
) )
.then((res) => { .then((res) => {
if(res.data.resultCode==='200'){ if(res.data.resultCode==='200'){
if(!this.timeOutVideo){ this.$toast('上传成功')
res.data.data.fileList.forEach(item=>{ res.data.data.fileList.forEach(item=>{
this.form.videos.push(item.fileUrl); this.form.videos.push(item.fileUrl);
this.videoIds.push(item.id); this.videoIds.push(item.id);
}) })
}
}else{ }else{
this.$toast(res.data.message) this.$toast(res.data.message)
......
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