From 9d809221eb4debba088ac2e56e63315b7596a30b Mon Sep 17 00:00:00 2001 From: peng <peng.com> Date: 星期二, 16 九月 2025 14:50:41 +0800 Subject: [PATCH] 解决图片显示问题和实物商品与虚拟商品中不包含礼品卡时去除优惠卷id和名称 --- framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoServiceImpl.java | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoServiceImpl.java b/framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoServiceImpl.java index 9e8fde1..9b1ef82 100644 --- a/framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoServiceImpl.java @@ -743,8 +743,12 @@ } if (VideoContentTypeEnum.VIDEO.getValue().equals(v.getVideoContentType())) { v.setVideoUrl(cosUtil.getPreviewUrl(v.getVideoFileKey())); + String coverFileKey = v.getCoverFileKey(); - v.setCoverUrl(cosUtil.getPreviewUrl(coverFileKey)); + if (StringUtils.isNotBlank(coverFileKey) && !coverFileKey.contains("http")) { + v.setCoverUrl(cosUtil.getPreviewUrl(coverFileKey)); + } + } else if (VideoContentTypeEnum.IMG.getValue().equals(v.getVideoContentType()) && StringUtils.isNotBlank(v.getVideoImgs())) { v.setImgs(JSON.parseArray(v.getVideoImgs(), String.class).stream().map(fileKey -> cosUtil.getPreviewUrl(fileKey)).collect(Collectors.toList())); } @@ -1537,7 +1541,10 @@ v.setAuthorAvatar(cosUtil.getPreviewUrl(v.getAuthorAvatar())); if (VideoContentTypeEnum.VIDEO.getValue().equals(v.getVideoContentType())) { v.setVideoUrl(cosUtil.getPreviewUrl(v.getVideoFileKey())); - v.setCoverUrl(cosUtil.getPreviewUrl(v.getCoverFileKey())); + if(StringUtils.isNotBlank(v.getCoverFileKey())){ + v.setCoverUrl(cosUtil.getPreviewUrl(v.getCoverFileKey())); + } + } else if (VideoContentTypeEnum.IMG.getValue().equals(v.getVideoContentType()) && StringUtils.isNotBlank(v.getVideoImgs())) { v.setImgs(JSON.parseArray(v.getVideoImgs(), String.class).stream().map(fileKey -> cosUtil.getPreviewUrl(fileKey)).collect(Collectors.toList())); } -- Gitblit v1.8.0