From 22809d7984209bf1719e0f44b4de061fa542fe4d Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Fri, 3 Jan 2020 16:05:28 +0800 Subject: [PATCH] =?UTF-8?q?feat(#I17SD0):=20=E7=BD=91=E7=AB=99=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E5=A2=9E=E5=8A=A0=E9=BB=98=E8=AE=A4=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #Issue link https://gitee.com/LongbowEnterprise/dashboard/issues?id=I17SD0 --- .../Controllers/Api/SettingsController.cs | 2 +- .../Bootstrap.Admin/Models/SettingsModel.cs | 6 ++++++ .../Bootstrap.Admin/Views/Admin/Settings.cshtml | 16 ++++++++++++++++ src/admin/Bootstrap.Admin/wwwroot/js/settings.js | 6 ++++++ 4 files changed, 29 insertions(+), 1 deletion(-) 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; } });