diff --git a/src/admin/Bootstrap.Admin/Controllers/AccountController.cs b/src/admin/Bootstrap.Admin/Controllers/AccountController.cs index 739c784f..3a63eeca 100644 --- a/src/admin/Bootstrap.Admin/Controllers/AccountController.cs +++ b/src/admin/Bootstrap.Admin/Controllers/AccountController.cs @@ -74,16 +74,17 @@ namespace Bootstrap.Admin.Controllers /// 系统登录方法 /// /// + /// /// [HttpGet] - public ActionResult Login([FromQuery]string? appId = null) + public ActionResult Login([FromQuery]string? appId = null, [FromQuery]string? view = "Login") { if (DictHelper.RetrieveSystemModel()) { ViewBag.UserName = "Admin"; ViewBag.Password = "123789"; } - return User.Identity.IsAuthenticated ? (ActionResult)Redirect("~/Home/Index") : View("Login", new LoginModel(appId)); + return User.Identity.IsAuthenticated ? (ActionResult)Redirect("~/Home/Index") : View(view, new LoginModel(appId)); } /// diff --git a/src/admin/Bootstrap.Admin/Views/Account/Login1.cshtml b/src/admin/Bootstrap.Admin/Views/Account/Login1.cshtml new file mode 100644 index 00000000..d792b230 --- /dev/null +++ b/src/admin/Bootstrap.Admin/Views/Account/Login1.cshtml @@ -0,0 +1,292 @@ +@model LoginModel +@{ + ViewBag.Title = Model.Title; + Layout = "_Layout"; +} +@section css { + + + + + + + + + + + +} +@section javascript { + + + + + + + + + + + + + + +} +
+ +
+ + diff --git a/src/admin/Bootstrap.Admin/wwwroot/css/login1.css b/src/admin/Bootstrap.Admin/wwwroot/css/login1.css new file mode 100644 index 00000000..60934b63 --- /dev/null +++ b/src/admin/Bootstrap.Admin/wwwroot/css/login1.css @@ -0,0 +1,178 @@ +body { + -webkit-font-smoothing: antialiased; +} + +.form-control:focus { + border-color: #66afe9; + -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102,175,233,.6); + box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102,175,233,.6); +} + +.login-wrap .rememberPwd i { + width: 13px; +} + +.login-wrap .rememberPwd { + cursor: pointer; + margin-left: 2px; +} + +.container-fluid { + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + display: flex; + align-items: center; + justify-content: center; + min-width: 1000px; +} + +.login-container { + min-height: 500px; + box-shadow: 0px 20px 80px 0px rgba(0,0,0,0.3); + display: flex; + width: 1000px; +} + + .login-container section { + width: 50%; + } + + .login-container .login-sidebox { + position: relative; + background: -webkit-gradient(linear, left bottom, left top, from(#3a485a), to(#607089)); + background: linear-gradient(0deg, #3a485a 0%, #607089 100%); + color: #fff; + } + + .login-container .login-sidebox::before, .login-container .login-sidebox::after { + content: ''; + top: 0; + right: 0; + bottom: 0; + left: 0; + position: absolute; + } + + .login-container .login-sidebox::before { + background: url(../images/left-1.png) no-repeat 0 0; + } + + .login-container .login-sidebox::after { + background: url(../images/left-2.png) no-repeat right bottom; + } + + .login-container .login-sidebox .login-sidebox-content { + padding: 80px 80px 48px; + position: relative; + z-index: 1; + } + + .login-sidebox-header { + margin-bottom: 40px; + } + + .login-sidebox-logo { + display: flex; + align-items: center; + margin-bottom: 14px; + } + + .login-sidebox-logo img { + width: 48px; + height: auto; + border-radius: 50%; + margin-right: 14px; + } + + .login-sidebox-logo span { + display: inline; + font-size: 1.5rem; + font-weight: 700; + } + + .login-sidebox-subtitle { + font-size: 20pt; + font-weight: normal; + } + + .login-sidebox-footer { + margin-top: 40px; + border-top: solid 1px #ddd; + padding-top: 28px; + font-size: 0.875rem; + font-weight: 500; + } + + .login-sidebox-footer a { + cursor: pointer; + color: #fff; + } + + .login-form { + padding: 64px; + font-size: 0.875rem; + } + +.login-form-header { + display: flex; + justify-content: space-between; + align-items: flex-end; + margin-bottom: 20px; +} + +.login-form-header h2 { + margin-bottom: 0; + font-size: 1.714rem; +} + +.login-other { + display: table; + text-align: center; + white-space: nowrap; + margin: 0.25rem 0 0.625rem 0; +} + + .login-other:before, .login-other:after { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABaAAAAACCAYAAACuTHuKAAAAGXRFWHRTb2Z0d2FyZQBBZG9i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REY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+VU513gAAADVJREFUeNrs0DENACAQBDBIWLGBJQby/mUcJn5sJXQmOQMAAAAAAJqt+2prAAAAAACg2xdgANk6BEVuJgyMAAAAAElFTkSuQmCC"); + content: ''; + display: table-cell; + position: relative; + top: 50%; + width: 50%; + background-repeat: no-repeat; + } + + .login-other:before { + background-position: right 1em top 50%; + } + + .login-other:after { + background-position: left 1em top 50%; + } + +.login-list { + display: flex; + justify-content: space-between; +} + + .login-list .item { + width: 32px; + height: 32px; + } + +.btn-login { + color: #fff; + background: #fe7300; +} + +.btn-login:hover { + background: #f38d30; + color: #fff; +} + +.forget-password { + padding: 16px 0; +} \ No newline at end of file diff --git a/src/admin/Bootstrap.Admin/wwwroot/html/login1.html b/src/admin/Bootstrap.Admin/wwwroot/html/login1.html new file mode 100644 index 00000000..b71c2663 --- /dev/null +++ b/src/admin/Bootstrap.Admin/wwwroot/html/login1.html @@ -0,0 +1,163 @@ + + + + + + + + + + + 健康检查 + + + + + + + + + +
+ +
+ + + + + + + + + + \ No newline at end of file diff --git a/src/admin/Bootstrap.Admin/wwwroot/images/left-1.png b/src/admin/Bootstrap.Admin/wwwroot/images/left-1.png new file mode 100644 index 00000000..171999df Binary files /dev/null and b/src/admin/Bootstrap.Admin/wwwroot/images/left-1.png differ diff --git a/src/admin/Bootstrap.Admin/wwwroot/images/left-2.png b/src/admin/Bootstrap.Admin/wwwroot/images/left-2.png new file mode 100644 index 00000000..42cc4d26 Binary files /dev/null and b/src/admin/Bootstrap.Admin/wwwroot/images/left-2.png differ diff --git a/src/admin/Bootstrap.Admin/wwwroot/lib/longbow/longbow.common.js b/src/admin/Bootstrap.Admin/wwwroot/lib/longbow/longbow.common.js index ceceeeca..8661857c 100644 --- a/src/admin/Bootstrap.Admin/wwwroot/lib/longbow/longbow.common.js +++ b/src/admin/Bootstrap.Admin/wwwroot/lib/longbow/longbow.common.js @@ -298,6 +298,7 @@ $.fn.extend({ autoCenter: function (options) { + if (this.length === 0) return; options = $.extend({ top: 0 }, options); var that = this; var defaultVal = parseFloat(that.css('marginTop').replace('px', '')); diff --git a/test/UnitTest/Bootstrap.Admin/Controllers/LoginTest.cs b/test/UnitTest/Bootstrap.Admin/Controllers/LoginTest.cs index d39bbb3a..680756f2 100644 --- a/test/UnitTest/Bootstrap.Admin/Controllers/LoginTest.cs +++ b/test/UnitTest/Bootstrap.Admin/Controllers/LoginTest.cs @@ -29,7 +29,7 @@ namespace Bootstrap.Admin.Controllers var content = await r.Content.ReadAsStringAsync(); Assert.Contains("登 录", content); - r = await client.GetAsync("/Account/Login"); + r = await client.GetAsync("/Account/Login?AppId=BA&View=Login1"); var view = await r.Content.ReadAsStringAsync(); var tokenTag = "