소스 검색

bug fixes

plf 4 년 전
부모
커밋
73ef0d3770
1개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 6 1
      src/main/java/com/caimei/www/service/page/impl/SinglePageServiceImpl.java

+ 6 - 1
src/main/java/com/caimei/www/service/page/impl/SinglePageServiceImpl.java

@@ -17,6 +17,7 @@ import org.springframework.http.ZeroCopyHttpOutputMessage;
 import org.springframework.http.server.reactive.ServerHttpResponse;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
+import org.springframework.util.StringUtils;
 import reactor.core.publisher.Mono;
 
 import javax.annotation.Resource;
@@ -53,7 +54,11 @@ public class SinglePageServiceImpl implements SinglePageService {
         }
         PageContent pageContent = singlePageDao.getFreePageById(id);
         String mobileContent = singlePageDao.findMobileContent(id);
-        pageContent.setMobileContent(mobileContent);
+        if (StringUtils.isEmpty(mobileContent)) {
+            pageContent.setMobileContent(pageContent.getContent());
+        } else {
+            pageContent.setMobileContent(mobileContent);
+        }
         return pageContent;
     }