This commit is contained in:
刘仕伟
2022-03-02 17:43:28 +08:00
parent 4d30281c5b
commit 66093030c2
2 changed files with 11 additions and 2 deletions

View File

@@ -130,7 +130,12 @@ export default {
this.articInfo.title = res.data.title;
this.articInfo.content = res.data.content;
this.articInfo.category = res.data.category
this.articInfo.thumbUrl = [{url: res.data.thumbUrl}]
if (res.data.thumbUrl) {
this.articInfo.thumbUrl = [{url: res.data.thumbUrl}]
} else {
this.articInfo.thumbUrl = []
}
}
})
}

View File

@@ -169,7 +169,11 @@ export default {
this.newsInfo.description = res.data.description;
this.newsInfo.category = res.data.category
this.newsInfo.videoUrl = res.data.videoUrl;
this.newsInfo.thumbUrl = [{url: res.data.thumbUrl}];
if (res.data.thumbUrl) {
this.newsInfo.thumbUrl = [{url: res.data.thumbUrl}]
} else {
this.newsInfo.thumbUrl = []
}
}
})
}