diff --git a/src/Web/Masa.Tsc.Web.Admin.Rcl/Pages/Apm/ErrorDetail.razor.cs b/src/Web/Masa.Tsc.Web.Admin.Rcl/Pages/Apm/ErrorDetail.razor.cs index 96535054..14e6c65a 100644 --- a/src/Web/Masa.Tsc.Web.Admin.Rcl/Pages/Apm/ErrorDetail.razor.cs +++ b/src/Web/Masa.Tsc.Web.Admin.Rcl/Pages/Apm/ErrorDetail.razor.cs @@ -83,6 +83,8 @@ protected override async Task OnParametersSetAsync() private async Task LoadLogAysnc() { currentLog = default!; + _dic = new Dictionary(); + total = 0; var query = new BaseRequestDto { Service = Search.Service!, @@ -117,21 +119,19 @@ private async Task LoadLogAysnc() } } query.Conditions = list; - var result = await ApiCaller.ApmService.GetLogListAsync(GlobalConfig.CurrentTeamId, query, Search.Project, Search.ServiceType); - if (currentPage == 1) + var result = await ApiCaller.ApmService.GetLogListAsync(GlobalConfig.CurrentTeamId, query, Search.Project, Search.ServiceType, ignoreTeam: !string.IsNullOrEmpty(Search.TraceId)); + if (result != null) { - total = (int)result.Total; - } + if (currentPage == 1) + { + total = (int)result.Total; + } - if (result.Result == null || !result.Result.Any()) - { - currentLog = null; - _dic = new Dictionary(); - } - else - { - currentLog = result.Result[0]; - _dic = currentLog.ToDictionary(); + if (result.Result != null && result.Result.Any()) + { + currentLog = result.Result[0]; + _dic = currentLog.ToDictionary(); + } } }