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, "演示系统"); } }