增加功能:配置文件配置超级管理员与密码,由LgbPricipal类判断

This commit is contained in:
Argo-Lenovo 2016-11-28 12:45:08 +08:00
parent 95ee511e27
commit c74c156d93
2 changed files with 3 additions and 2 deletions

View File

@ -51,9 +51,9 @@ namespace Bootstrap.Admin.Controllers
var model = new LoginModel();
if (string.IsNullOrEmpty(userName)) return View(model);
model.UserName = userName;
if (LgbPrincipal.IsAdmin(userName) || UserHelper.Authenticate(userName, password))
if (LgbPrincipal.IsAdmin(userName, password) || UserHelper.Authenticate(userName, password))
{
FormsAuthentication.RedirectFromLoginPage(userName, false);
FormsAuthentication.RedirectFromLoginPage(userName, remember == "true");
}
return View(model);
}

View File

@ -17,6 +17,7 @@
<add key="ClientValidationEnabled" value="true"/>
<add key="UnobtrusiveJavaScriptEnabled" value="true"/>
<add key="Admins" value="Argo;Test"/>
<add key="Passwords" value="3oXfIiPEbZVE+d8JeeLCCcgrTFBq813HGCFv9StZ8EA=;OYefBWRKrVPOrADTAe/YjY3LAOCuv2WCEXwE2An1X68="/>
</appSettings>
<connectionStrings>