소스 검색

修改报错

yumeng 6 년 전
부모
커밋
8e7f75e763
1개의 변경된 파일9개의 추가작업 그리고 10개의 파일을 삭제
  1. 9 10
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/ActorController.java

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

@@ -227,11 +227,18 @@ public class ActorController {
         Result<Actor> result = new Result<Actor>();
         try {
 
+            String coverUrl = actor.getCoverUrl();
+            if (!Check.isNull(coverUrl)) {
+                if (!coverUrl.contains(KuaishouInterfaceConstant.HTTPS_PREFIX)) {
+                    actor.setCoverUrl(KuaishouInterfaceConstant.HTTPS_PREFIX + coverUrl);
+                }
+            }
+            actorService.save(actor);
+
             if (actor.getImageUrl() != null && actor.getImageUrl().size() > 0) {
                 for (String url : actor.getImageUrl()) {
                     ActorPhoto photo = new ActorPhoto();
                     photo.setActorId(actor.getId());
-
                     if (!Check.isNull(url)) {
                         if (!url.contains(KuaishouInterfaceConstant.HTTPS_PREFIX)) {
                             photo.setPhotoUrl(KuaishouInterfaceConstant.HTTPS_PREFIX + url);
@@ -249,19 +256,11 @@ public class ActorController {
                             video.setVideoUrl(KuaishouInterfaceConstant.HTTPS_PREFIX + url);
                         }
                     }
-
-
                     actorVideoService.save(video);
                 }
             }
 
-            String coverUrl = actor.getCoverUrl();
-            if (!Check.isNull(coverUrl)) {
-                if (!coverUrl.contains(KuaishouInterfaceConstant.HTTPS_PREFIX)) {
-                    actor.setCoverUrl(KuaishouInterfaceConstant.HTTPS_PREFIX + coverUrl);
-                }
-            }
-            actorService.save(actor);
+
             result.success("添加成功!");
         } catch (Exception e) {
             log.error(e.getMessage(), e);