李昊 преди 4 години
родител
ревизия
da2336d87c
променени са 1 файла, в които са добавени 16 реда и са изтрити 0 реда
  1. 16 0
      gx_api/GxPress/Service/GxPress.Service.Implement/Epub/EpubService.cs

+ 16 - 0
gx_api/GxPress/Service/GxPress.Service.Implement/Epub/EpubService.cs

@@ -90,6 +90,7 @@ namespace GxPress.Service.Implement.Epub
             foreach (EpubNavigationItem chapter in epubBook.Navigation)
             {
 
+
                 if (chapter.HtmlContentFile.FileName.Equals(request.CatalogId) || chapter.Title.Equals(request.CatalogNameg))
                 {
                     if (i > sectionValue && sectionValue > 0)
@@ -101,6 +102,21 @@ namespace GxPress.Service.Implement.Epub
                     htmlContent = HtmlAgilityPackHelper.GetHmtl(chapter.HtmlContentFile.Content);
                     break;
                 }
+                foreach (var item in chapter.NestedItems)
+                {
+                    if (item.HtmlContentFile.FileName.Equals(request.CatalogId) || item.Title.Equals(request.CatalogNameg))
+                    {
+                        if (i > sectionValue && sectionValue > 0)
+                        {
+                            htmlContent = HtmlAgilityPackHelper.GetHmtlContent(item.HtmlContentFile.Content);
+                            break;
+                        }
+                        //当前文本内容文件的HTML
+                        htmlContent = HtmlAgilityPackHelper.GetHmtl(item.HtmlContentFile.Content);
+                        break;
+                    }
+                    i++;
+                }
                 i++;
             }
             return htmlContent;