Merge branch 'dev'

This commit is contained in:
Argo Zhang 2019-04-23 21:59:43 +08:00
commit f77c2906d5
7 changed files with 43 additions and 25 deletions

Binary file not shown.

View File

@ -56,8 +56,8 @@ namespace Bootstrap.Admin.Controllers
// redirect origin url // redirect origin url
var originUrl = Request.Query[CookieAuthenticationDefaults.ReturnUrlParameter].FirstOrDefault() ?? "~/Home/Index"; var originUrl = Request.Query[CookieAuthenticationDefaults.ReturnUrlParameter].FirstOrDefault() ?? "~/Home/Index";
return Redirect(originUrl); return Redirect(originUrl);
} }
return View("Login", new LoginModel()); return View("Login", new LoginModel() { AuthFailed = true });
} }
/// <summary> /// <summary>

View File

@ -14,10 +14,15 @@ namespace Bootstrap.Admin.Models
{ {
ImageLibUrl = DictHelper.RetrieveImagesLibUrl(); ImageLibUrl = DictHelper.RetrieveImagesLibUrl();
} }
/// <summary> /// <summary>
/// 验证码图床地址 /// 验证码图床地址
/// </summary> /// </summary>
public string ImageLibUrl { get; protected set; } public string ImageLibUrl { get; protected set; }
/// <summary>
/// 是否登录认证失败
/// </summary>
public bool AuthFailed { get; set; }
} }
} }

View File

@ -46,6 +46,14 @@
<form id="login" method="post" class="form-signin"> <form id="login" method="post" class="form-signin">
<h2 class="form-signin-heading">@Model.Title</h2> <h2 class="form-signin-heading">@Model.Title</h2>
<div class="login-wrap" data-toggle="LgbValidate" data-valid-button="button[type='submit']"> <div class="login-wrap" data-toggle="LgbValidate" data-valid-button="button[type='submit']">
@if (Model.AuthFailed)
{
<div class="alert alert-danger">用户名或密码错误!</div>
}
else
{
<div class="alert alert-success">请输入用户名与密码</div>
}
<div class="form-group"> <div class="form-group">
<div class="input-group"> <div class="input-group">
<div class="input-group-prepend"> <div class="input-group-prepend">

View File

@ -31,17 +31,21 @@
.login-wrap { .login-wrap {
padding: 0; padding: 0;
margin: 36px 0 0 370px; margin: 12px 0 0 370px;
width: 280px; width: 280px;
} }
.slidercaptcha { .slidercaptcha {
top: -254px; top: -282px;
left: -15px; left: -15px;
} }
.slidercaptcha, .slidercaptcha.forgot { .slidercaptcha, .slidercaptcha.forgot {
width: 310px; width: 310px;
height: 280px; height: 280px;
}
.form-signin .form-group {
margin-bottom: 0.75rem;
} }
} }

View File

@ -14,7 +14,7 @@
.login-wrap { .login-wrap {
padding: 20px; padding: 20px;
height: 270px; height: 330px;
} }
.login-wrap .rememberPwd { .login-wrap .rememberPwd {
@ -87,16 +87,16 @@
color: #fff; color: #fff;
} }
.slidercaptcha.forgot { .slidercaptcha.forgot {
position: absolute; position: absolute;
left: auto; left: auto;
right: 14px; right: 14px;
bottom: 14px; bottom: 14px;
top: auto; top: auto;
margin: 0; margin: 0;
width: 274px; width: 274px;
} }
.slidercaptcha.reg { .slidercaptcha.reg {
bottom: 60px; bottom: 60px;
} }

View File

@ -96,7 +96,8 @@
width: $.capWidth(), width: $.capWidth(),
height: $.capHeight(), height: $.capHeight(),
localImages: function () { localImages: function () {
return '../../lib/captcha/images/Pic' + Math.round(Math.random() * 4) + '.jpg'; var base = $('#pathBase').attr('href');
return base + 'lib/captcha/images/Pic' + Math.round(Math.random() * 4) + '.jpg';
}, },
setSrc: function () { setSrc: function () {
return $imgUrl.val() + 'Pic' + Math.round(Math.random() * 136) + '.jpg'; return $imgUrl.val() + 'Pic' + Math.round(Math.random() * 136) + '.jpg';