增加登录验证码设置

This commit is contained in:
2024-03-07 18:35:05 +08:00
parent 01dbb4461d
commit 653dffc14f
3 changed files with 27 additions and 1 deletions
@@ -50,6 +50,7 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
{
string strUserName = Request.Form["username"];
string strPassWord = Request.Form["password"];
string code = Request.Form["code"];
if (strUserName.Length % 8 != 0)
{
@@ -69,6 +70,21 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers
tip.Other = "reload";
return Json(tip);
}
if (Utils.GetSetting("SystemSetting:AdminLoginWithCode") == "1")
{
if (string.IsNullOrEmpty(code))
{
tip.Message = "请输入验证码!";
return Json(tip);
}
if (!VerifyCodeHelper.GetSingleObj().VerifyCodeIsOK(code))
{
tip.Message = "验证码错误!";
return Json(tip);
}
}
//解密
string username = "";
string password = "";