feat(#I135OT): 完善客户端执行脚本功能

#Issue
link #I135OT
This commit is contained in:
Argo Zhang 2019-10-19 17:59:14 +08:00
parent 288c7fd547
commit e68287a3c2
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
2 changed files with 3 additions and 4 deletions

View File

@ -7,7 +7,6 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Linq;
namespace Bootstrap.Client.Controllers
{
@ -57,7 +56,7 @@ namespace Bootstrap.Client.Controllers
int num = 0;
if (string.IsNullOrEmpty(sql)) num = -2;
else if (Longbow.Security.Cryptography.LgbCryptography.ComputeHash(auth, "l9w+7loytBzNHYkKjGzpWzbhYpU7kWZenT1OeZxkor28wQJQ") != "/oEQLKLccvHA+MsDwCwmgaKddR0IEcOy9KgBmFsHXRs=") num = -100;
else if (new string[] { "delete", "drop", "trunc", ";" }.Any(s => sql.Contains(s, StringComparison.OrdinalIgnoreCase))) num = -10;
else num = ExecuteSql(sql);
return View(new SQLModel(this) { Result = num });
}

View File

@ -1,4 +1,4 @@
@model SQLModel
@model SQLModel
@{
ViewData["Title"] = "SQL 脚本执行器";
}
@ -8,7 +8,7 @@
</div>
<div class="form-group">
<div class="input-group">
<input type="password" name="auth" class="form-control"></input>
<input type="password" name="auth" class="form-control" />
<div class="input-group-append">
<button type="submit" class="btn btn-danger"><i class="fa fa-exclamation-triangle" aria-hidden="true"></i><span>执行 (@Model.Result)</span></button>
</div>