|
@@ -238,9 +238,11 @@ export default {
|
|
|
mounted() {},
|
|
|
methods: {
|
|
|
typeVideo(str) {
|
|
|
- let type = str.slice(str.lastIndexOf('.') + 1, str.length);
|
|
|
- let videoType = ['mp4'];
|
|
|
- return videoType.includes(type);
|
|
|
+ if (str) {
|
|
|
+ let type = str.slice(str.lastIndexOf('.') + 1, str.length);
|
|
|
+ let videoType = ['mp4'];
|
|
|
+ return videoType.includes(type);
|
|
|
+ }
|
|
|
},
|
|
|
lookVideos(src) {
|
|
|
new Promise((resolve) => {
|
|
@@ -326,8 +328,10 @@ export default {
|
|
|
if (res.status === 0) {
|
|
|
if (res.data.file) {
|
|
|
let file = res.data.file;
|
|
|
- let mediaList = file.split(',');
|
|
|
- this.mediaList.length = 3;
|
|
|
+ this.mediaList = file.split(',');
|
|
|
+ if (this.mediaList.length >= 3) {
|
|
|
+ this.mediaList.length = 3;
|
|
|
+ }
|
|
|
|
|
|
this.srcList = this.mediaList.filter((item) => {
|
|
|
return item !== 'mp4';
|