瀏覽代碼

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;
     }