diff --git a/src/admin/Bootstrap.Admin/Controllers/Api/SettingsController.cs b/src/admin/Bootstrap.Admin/Controllers/Api/SettingsController.cs index ec0bb679..02f5b8bc 100644 --- a/src/admin/Bootstrap.Admin/Controllers/Api/SettingsController.cs +++ b/src/admin/Bootstrap.Admin/Controllers/Api/SettingsController.cs @@ -22,7 +22,7 @@ namespace Bootstrap.Admin.Controllers.Api /// /// [HttpPost] - [ButtonAuthorize(Url = "~/Admin/Settings", Auth = "saveTitle,saveFooter,saveTheme,saveUISettings")] + [ButtonAuthorize(Url = "~/Admin/Settings", Auth = "saveTitle,saveFooter,saveTheme,saveUISettings,clearCache,clearAllCache,loginSettings,lockScreen,defaultApp")] public bool Post([FromBody]BootstrapDict value) => DictHelper.SaveSettings(value); /// diff --git a/src/admin/Bootstrap.Admin/Models/SettingsModel.cs b/src/admin/Bootstrap.Admin/Models/SettingsModel.cs index 8d685ffc..ffeab346 100644 --- a/src/admin/Bootstrap.Admin/Models/SettingsModel.cs +++ b/src/admin/Bootstrap.Admin/Models/SettingsModel.cs @@ -18,6 +18,7 @@ namespace Bootstrap.Admin.Models { Themes = DictHelper.RetrieveThemes(); AutoLockScreen = EnableAutoLockScreen ? "" : "lockScreen"; + DefaultApp = DictHelper.RetrieveDefaultApp() ? "" : "defaultApp"; } /// @@ -29,5 +30,10 @@ namespace Bootstrap.Admin.Models /// 获得 是否开启自动锁屏 /// public string AutoLockScreen { get; } + + /// + /// 获得 是否开启自动锁屏 + /// + public string DefaultApp { get; } } } diff --git a/src/admin/Bootstrap.Admin/Views/Admin/Settings.cshtml b/src/admin/Bootstrap.Admin/Views/Admin/Settings.cshtml index 3af6d769..fb64e909 100644 --- a/src/admin/Bootstrap.Admin/Views/Admin/Settings.cshtml +++ b/src/admin/Bootstrap.Admin/Views/Admin/Settings.cshtml @@ -143,6 +143,22 @@ +
+
默认应用设置
+
+
+
+
+ + +
+
+
+ +
+
diff --git a/src/admin/Bootstrap.Admin/wwwroot/js/settings.js b/src/admin/Bootstrap.Admin/wwwroot/js/settings.js index af739de1..33bd25dd 100644 --- a/src/admin/Bootstrap.Admin/wwwroot/js/settings.js +++ b/src/admin/Bootstrap.Admin/wwwroot/js/settings.js @@ -76,6 +76,12 @@ $(function () { } }); break; + case 'saveDefaultApp': + var defaultApp = $('#defaultApp').prop('checked') ? "1" : "0"; + $.bc({ + url: Settings.url, data: { name: '默认应用程序', code: defaultApp, category: '系统设置' }, title: '保存默认应用程序设置', method: "post" + }); + break; } });