parent
288c7fd547
commit
e68287a3c2
|
@ -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 });
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue