From 9fe0aefb466a87815ef450cb4ef99405dad63b4e Mon Sep 17 00:00:00 2001
From: peng <peng.com>
Date: 星期一, 17 十一月 2025 11:49:11 +0800
Subject: [PATCH] 中奖用户打* 解决首页视频显示不全问题

---
 framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoServiceImpl.java |   13 +++++++++++--
 1 files changed, 11 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 6e7c7cb..5f525a8 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
@@ -757,6 +757,7 @@
 
                 } 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()));
+                    v.setVideoUrl("");
                 }
                 if (CollectionUtils.isNotEmpty(v.getGoodsList())) {
                     v.getGoodsList().stream().forEach(goods -> {
@@ -989,6 +990,9 @@
         } else {
             vo.setLikeNum(0L);
         }
+        if (StringUtils.isNotBlank(vo.getAvatar())&&!vo.getAvatar().contains("http")) {
+            vo.setAvatar(cosUtil.getPreviewUrl(vo.getAvatar()));
+        }
         return Result.ok().data(vo);
     }
 
@@ -1016,7 +1020,9 @@
                 v.setCommentNum(this.getCommentNum(v.getId(), v.getCommentNum()));
                 v.setCollectNum(this.getCollectNum(v.getId(), v.getCollectNum()));
                 v.setThumbsUpNum(this.getThumbsUpNum(v.getId(), v.getThumbsUpNum()));
-                v.setAuthorAvatar(cosUtil.getPreviewUrl(v.getAuthorAvatar()));
+                if (StringUtils.isNotBlank(v.getAuthorAvatar())&&!v.getAuthorAvatar().contains("http")) {
+                    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()));
@@ -1093,7 +1099,10 @@
                 v.setCommentNum(this.getCommentNum(v.getId(), v.getCommentNum()));
                 v.setCollectNum(this.getCollectNum(v.getId(), v.getCollectNum()));
                 v.setThumbsUpNum(this.getThumbsUpNum(v.getId(), v.getThumbsUpNum()));
-                v.setAuthorAvatar(cosUtil.getPreviewUrl(v.getAuthorAvatar()));
+                String authorAvatar = v.getAuthorAvatar();
+                if (StringUtils.isNotBlank(authorAvatar)&&!authorAvatar.contains("http")) {
+                    v.setAuthorAvatar(cosUtil.getPreviewUrl(authorAvatar));
+                }
                 if (VideoContentTypeEnum.VIDEO.getValue().equals(v.getVideoContentType())) {
                     v.setVideoUrl(cosUtil.getPreviewUrl(v.getVideoFileKey()));
                     v.setCoverUrl(cosUtil.getPreviewUrl(v.getCoverFileKey()));

--
Gitblit v1.8.0