图片显示问题

This commit is contained in:
daihh
2023-03-10 02:41:58 +08:00
parent b4cab402b8
commit 813cffcbe6
2 changed files with 8 additions and 2 deletions

View File

@@ -65,10 +65,10 @@ export default {
}, },
imageUrl() { imageUrl() {
this.isShow = false; this.isShow = false;
if(this.course && this.course.coverImg && this.course.coverImg.startsWith('h')) { if(this.course && this.course.coverImg && this.course.coverImg.startsWith('http')) {
return this.course.coverImg; return this.course.coverImg;
} }
if(this.course && this.course.courseImage && this.course.courseImage.startsWith('h')) { if(this.course && this.course.courseImage && this.course.courseImage.startsWith('http')) {
return this.course.courseImage; return this.course.courseImage;
} }
if (this.course && this.course.coverImg && this.course.coverImg != "") { if (this.course && this.course.coverImg && this.course.coverImg != "") {

View File

@@ -183,6 +183,7 @@ export default {
if(flag){ if(flag){
this.page.pageIndex=1; this.page.pageIndex=1;
} }
let $this=this;
this.isSearch=false; this.isSearch=false;
let reqData={ let reqData={
courseName:this.params.courseName, courseName:this.params.courseName,
@@ -198,6 +199,11 @@ export default {
this.loading=true; this.loading=true;
apiCourseStudy.myStudysFromES(reqData).then(res=>{ apiCourseStudy.myStudysFromES(reqData).then(res=>{
if(res.status==200){ if(res.status==200){
res.result.list.forEach(item=>{
if(item.courseImage.startsWith('/upload')){
item.courseImage=$this.fileUrl+item.courseImage.substring(7)
}
})
this.couresList=res.result.list; this.couresList=res.result.list;
this.page.count=res.result.count; this.page.count=res.result.count;
}else{ }else{