From e4aad63bd8104b30179dc3cb577f6408686d46a6 Mon Sep 17 00:00:00 2001 From: "Argo Zhang (Win)" Date: Fri, 9 Aug 2019 14:12:35 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E6=9B=B4=E6=94=B9?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E8=BF=90=E8=A1=8C=E6=A8=A1=E5=BC=8F=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E4=BE=BF=E4=BA=8E=E7=BB=B4=E6=8A=A4=E7=B3=BB=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #Comment comment 网页直接敲命令即可更改演示模式 api/Admin?salt=BootstrapAdmin-Salt&model=1&authCode=ucct --- .../Controllers/AdminController.cs | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Bootstrap.Client/Controllers/AdminController.cs diff --git a/Bootstrap.Client/Controllers/AdminController.cs b/Bootstrap.Client/Controllers/AdminController.cs new file mode 100644 index 00000000..55561cd0 --- /dev/null +++ b/Bootstrap.Client/Controllers/AdminController.cs @@ -0,0 +1,31 @@ +using Microsoft.AspNetCore.Mvc; + +namespace Bootstrap.Client.Controllers +{ + /// + /// 运维管理接口 + /// + [Route("api/[controller]")] + [ApiController] + public class AdminController : ControllerBase + { + /// + /// 更改系统运行模式 1 为演示模式 0 为正常模式 + /// + [HttpGet] + public bool Get([FromQuery]string authCode, string salt, int model) + { + var ret = false; + // 检查授权 + if (Longbow.Security.Cryptography.LgbCryptography.ComputeHash(authCode, salt) == "3lpCnRu7qqiAbIrx7gNRUB0mPXgJC3wGoyPJED3KeoA=") + { + using (var db = Longbow.Data.DbManager.Create("ba")) + { + db.Execute("Update Dicts Set Code = @0 Where Category = @1 and Name = @2", model, "系统设置", "演示系统"); + } + ret = true; + } + return ret; + } + } +}