From 57225c0937e3dd8e45ef27f782ae7ab183c0cbae Mon Sep 17 00:00:00 2001 From: Argo-Lenovo Date: Sat, 1 Jan 2022 15:44:08 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E6=BC=94=E7=A4=BA=E4=BF=9D=E5=AD=98=E7=BB=93=E6=9E=9C=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/DictService.cs | 4 ++-- .../admin/BootstrapAdmin.Web/Pages/Admin/Settings.razor.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/blazor/admin/BootstrapAdmin.DataAccess.PetaPoco/Services/DictService.cs b/src/blazor/admin/BootstrapAdmin.DataAccess.PetaPoco/Services/DictService.cs index b0a00223..4a1ced77 100644 --- a/src/blazor/admin/BootstrapAdmin.DataAccess.PetaPoco/Services/DictService.cs +++ b/src/blazor/admin/BootstrapAdmin.DataAccess.PetaPoco/Services/DictService.cs @@ -33,7 +33,7 @@ class DictService : BaseDatabase, IDict public Dictionary GetLogins() { var dicts = GetAll(); - return dicts.Where(d => d.Category == "系统首页").Select(d => new KeyValuePair(d.Code, d.Name)).ToDictionary(i => i.Key, i => i.Value); + return dicts.Where(d => d.Category == "系统首页").Select(d => new KeyValuePair(d.Code, d.Name)).OrderBy(i => i.Value).ToDictionary(i => i.Key, i => i.Value); } public string GetCurrentLogin() @@ -119,7 +119,7 @@ class DictService : BaseDatabase, IDict /// /// /// - public bool SaveDemo(bool isDemo) => Database.Execute("Update Dicts Set Code = @0 Where Category = @1 and Name = @2 and Define = @3", isDemo ? "1" : "0", "网站设置", "演示系统", EnumDictDefine.System.ToString()) == 1; + public bool SaveDemo(bool isDemo) => Database.Execute("Update Dicts Set Code = @0 Where Category = @1 and Name = @2 and Define = @3", isDemo ? "1" : "0", "网站设置", "演示系统", EnumDictDefine.System) == 1; /// /// diff --git a/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Settings.razor.cs b/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Settings.razor.cs index 42b0f5ec..e380e435 100644 --- a/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Settings.razor.cs +++ b/src/blazor/admin/BootstrapAdmin.Web/Pages/Admin/Settings.razor.cs @@ -99,8 +99,8 @@ namespace BootstrapAdmin.Web.Pages.Admin { IsDemo = AppInfo.IsDemo; ret = DictService.SaveDemo(IsDemo); + StateHasChanged(); } - StateHasChanged(); await ShowToast(ret, "演示系统"); } }