From f18229d58c87c6d8c872c7ca361826c6f18d214e Mon Sep 17 00:00:00 2001 From: Argo-Tianyi Date: Thu, 20 Jan 2022 10:51:40 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E9=87=8D=E6=9E=84=20GetHomeUrlByAp?= =?UTF-8?q?pId=20=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/DictService.cs | 4 +--- .../Services/DictService.cs | 12 ++---------- src/blazor/admin/BootstrapAdmin.Web.Core/IDict.cs | 2 +- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/src/blazor/admin/BootStarpAdmin.DataAccess.FreeSql/Service/DictService.cs b/src/blazor/admin/BootStarpAdmin.DataAccess.FreeSql/Service/DictService.cs index 6fafc5f1..f82e6b57 100644 --- a/src/blazor/admin/BootStarpAdmin.DataAccess.FreeSql/Service/DictService.cs +++ b/src/blazor/admin/BootStarpAdmin.DataAccess.FreeSql/Service/DictService.cs @@ -162,13 +162,11 @@ class DictService : IDict /// /// /// - public string? GetHomeUrlByAppId(string? appId = null) + public string? GetHomeUrlByAppId(string appId) { string? url = null; var dicts = GetAll(); - // appId 为空时读取前台列表取第一个应用作为默认应用 - appId ??= GetApps().FirstOrDefault(d => d.Key != "BA").Key ?? AppId; url = dicts.FirstOrDefault(d => d.Category == "应用首页" && d.Name.Equals(appId, StringComparison.OrdinalIgnoreCase) && d.Define == EnumDictDefine.System)?.Code; return url; } diff --git a/src/blazor/admin/BootstrapAdmin.DataAccess.PetaPoco/Services/DictService.cs b/src/blazor/admin/BootstrapAdmin.DataAccess.PetaPoco/Services/DictService.cs index d6ade37c..561da5f1 100644 --- a/src/blazor/admin/BootstrapAdmin.DataAccess.PetaPoco/Services/DictService.cs +++ b/src/blazor/admin/BootstrapAdmin.DataAccess.PetaPoco/Services/DictService.cs @@ -242,19 +242,11 @@ class DictService : IDict /// /// /// - public string? GetHomeUrlByAppId(string? appId = null) + public string? GetHomeUrlByAppId(string appId) { string? url = null; var dicts = GetAll(); - - // 查看是否开启默认应用 - var enableDefaultApp = GetEnableDefaultApp(); - if (enableDefaultApp) - { - // appId 为空时读取前台列表取第一个应用作为默认应用 - appId ??= GetApps().FirstOrDefault(d => d.Key != AppId).Key ?? AppId; - url = dicts.FirstOrDefault(d => d.Category == "应用首页" && d.Name.Equals(appId, StringComparison.OrdinalIgnoreCase) && d.Define == EnumDictDefine.System)?.Code; - } + url = dicts.FirstOrDefault(d => d.Category == "应用首页" && d.Name.Equals(appId, StringComparison.OrdinalIgnoreCase) && d.Define == EnumDictDefine.System)?.Code; return url; } diff --git a/src/blazor/admin/BootstrapAdmin.Web.Core/IDict.cs b/src/blazor/admin/BootstrapAdmin.Web.Core/IDict.cs index f326f54e..2eb0ea6b 100644 --- a/src/blazor/admin/BootstrapAdmin.Web.Core/IDict.cs +++ b/src/blazor/admin/BootstrapAdmin.Web.Core/IDict.cs @@ -174,7 +174,7 @@ public interface IDict /// /// /// - string? GetHomeUrlByAppId(string? appId = null); + string? GetHomeUrlByAppId(string appId); /// /// 是否开启默认应用