feat: 增加更改系统运行模式接口便于维护系统
#Comment comment 网页直接敲命令即可更改演示模式 api/Admin?salt=BootstrapAdmin-Salt&model=1&authCode=ucct
This commit is contained in:
parent
6476146148
commit
e4aad63bd8
|
@ -0,0 +1,31 @@
|
|||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Bootstrap.Client.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 运维管理接口
|
||||
/// </summary>
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class AdminController : ControllerBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 更改系统运行模式 1 为演示模式 0 为正常模式
|
||||
/// </summary>
|
||||
[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;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue