李昊 4 years ago
parent
commit
aeba34fe96

+ 1 - 0
gx_api/GxPress/Api/GxPress.Api/AdminControllers/AdminAppChannelController.cs

@@ -105,6 +105,7 @@ namespace GxPress.Api.AdminControllers
         /// </summary>
         /// <returns></returns>
         [HttpGet("channel-category/list/{appChannelId}")]
+        [AllowAnonymous]
         public async Task<IEnumerable<ChannelCategoryResult>> ChannelCategoryGetAllAsync(int appChannelId)
         {
             return await appChannelService.GetAllAsync(appChannelId);

+ 8 - 0
gx_api/GxPress/Service/GxPress.Service.Implement/AppChannel/AppChannelService.cs

@@ -62,6 +62,14 @@ namespace GxPress.Service.Implement.AppChannel
             {
                 if (!item.IsChildren)
                     item.MediaIds = await channelCategoryMediaRepository.GetAllAsync(item.Id);
+                else
+                {
+                    foreach (var category in item.Children)
+                    {
+                        if (!category.IsChildren)
+                            category.MediaIds = await channelCategoryMediaRepository.GetAllAsync(item.Id);
+                    }
+                }
             }
             return result;
         }