qinchaoyue 1 month ago
parent
commit
8452102b4c

+ 1 - 2
src/Hotline.Api/Controllers/FilterController/ExportDataController.cs

@@ -55,10 +55,9 @@ public class ExportDataController : BaseController
             .ToList()
             .ToList()
             ?? throw UserFriendlyException.SameMessage($"根据URL查询路由失败: {originalPath}");
             ?? throw UserFriendlyException.SameMessage($"根据URL查询路由失败: {originalPath}");
         var matchingEndpoint = matchingEndpoints.FirstOrDefault();
         var matchingEndpoint = matchingEndpoints.FirstOrDefault();
-        if (matchingEndpoint == null) throw UserFriendlyException.SameMessage($"根据URL查询路由失败: {originalPath}");
         if (matchingEndpoints.Count > 1)
         if (matchingEndpoints.Count > 1)
         {
         {
-            matchingEndpoint = matchingEndpoints.First(m => m.DisplayName.Contains("Get"));
+            matchingEndpoint = matchingEndpoints.FirstOrDefault(m => m.DisplayName.Contains("Get"));
         }
         }
         if (matchingEndpoint == null)
         if (matchingEndpoint == null)
             throw UserFriendlyException.SameMessage($"根据URL查询路由失败: {originalPath}");
             throw UserFriendlyException.SameMessage($"根据URL查询路由失败: {originalPath}");