浏览代码

添加 图片 视频 拼接url

yumeng 5 年之前
父节点
当前提交
4976ded674

+ 13 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ActorController.java

@@ -179,6 +179,12 @@ public class ActorController {
     public Result<ActorVideo> addVideo(ActorVideo actorVideo) {
         Result<ActorVideo> result = new Result<ActorVideo>();
         try {
+            String videoUrl = actorVideo.getVideoUrl();
+            if (!Check.isNull(videoUrl)) {
+                if (!videoUrl.contains(KuaishouInterfaceConstant.HTTPS_PREFIX)) {
+                    actorVideo.setVideoUrl(KuaishouInterfaceConstant.HTTPS_PREFIX + videoUrl);
+                }
+            }
             actorVideoService.save(actorVideo);
             result.success("添加成功!");
         } catch (Exception e) {
@@ -192,6 +198,13 @@ public class ActorController {
     public Result<ActorPhoto> addPhoto(ActorPhoto actorPhoto) {
         Result<ActorPhoto> result = new Result<ActorPhoto>();
         try {
+            String photoUrl = actorPhoto.getPhotoUrl();
+            if (!Check.isNull(photoUrl)) {
+                if (!photoUrl.contains(KuaishouInterfaceConstant.HTTPS_PREFIX)) {
+                    actorPhoto.setPhotoUrl(KuaishouInterfaceConstant.HTTPS_PREFIX + photoUrl);
+                }
+            }
+
             actorPhotoService.save(actorPhoto);
             result.success("添加成功!");
         } catch (Exception e) {