refactor: 改造登录首页组件

This commit is contained in:
Argo-Tianyi 2022-01-27 13:31:37 +08:00
parent a53c0cd791
commit 135f0615f5
5 changed files with 66 additions and 65 deletions

View File

@ -1,4 +1,6 @@
<form method="post" class="form-signin" action="@PostUrl" @ref="LoginForm"> <div class="wrap">
<div class="container">
<form method="post" class="form-signin" action="@PostUrl" @ref="LoginForm">
<h2 class="form-signin-heading">@Title</h2> <h2 class="form-signin-heading">@Title</h2>
<div class="@ClassString"> <div class="@ClassString">
@if (AllowMobile) @if (AllowMobile)
@ -33,3 +35,5 @@
</Block> </Block>
</div> </div>
</form> </form>
</div>
</div>

View File

@ -78,7 +78,7 @@ public partial class AdminLogin : IDisposable
base.OnInitialized(); base.OnInitialized();
Title = DictsService.GetWebTitle(); Title = DictsService.GetWebTitle();
PostUrl = QueryHelper.AddQueryString("/Account/Login", new Dictionary<string, string?> PostUrl = QueryHelper.AddQueryString("Account/Login", new Dictionary<string, string?>
{ {
["ReturnUrl"] = ReturnUrl, ["ReturnUrl"] = ReturnUrl,
["AppId"] = AppId ["AppId"] = AppId
@ -88,7 +88,7 @@ public partial class AdminLogin : IDisposable
void OnClickSwitchButton() void OnClickSwitchButton()
{ {
var rem = RememberPassword ? "true" : "false"; var rem = RememberPassword ? "true" : "false";
PostUrl = QueryHelper.AddQueryString(UseMobileLogin ? "/Account/Mobile" : "/Account/Login", new Dictionary<string, string?>() PostUrl = QueryHelper.AddQueryString(UseMobileLogin ? "Account/Mobile" : "Account/Login", new Dictionary<string, string?>()
{ {
[nameof(ReturnUrl)] = ReturnUrl, [nameof(ReturnUrl)] = ReturnUrl,
["AppId"] = AppId, ["AppId"] = AppId,

View File

@ -1,4 +1,29 @@
.form-signin-heading { .wrap {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
@media (min-width: 768px) {
.wrap {
background-color: #5bc0de;
background: url('../images/bg2.jpg') fixed no-repeat;
background-size: 100% 100%;
}
.container {
background: url('../images/bg3.png') no-repeat;
background-size: contain;
width: 704px;
height: 404px;
margin: 0 auto;
margin-top: calc(100vh / 2 - 190px);
}
}
.form-signin-heading {
margin: 0; margin: 0;
padding: 20px 15px; padding: 20px 15px;
text-align: center; text-align: center;

View File

@ -1,8 +1,4 @@
@layout LoginLayout @layout LoginLayout
@page "/Account/Login" @page "/Account/Login"
<div class="wrap">
<div class="container">
<AdminLogin ReturnUrl="@ReturnUrl" AppId="@AppId" /> <AdminLogin ReturnUrl="@ReturnUrl" AppId="@AppId" />
</div>
</div>

View File

@ -1,24 +0,0 @@
.wrap {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
@media (min-width: 768px) {
.wrap {
background-color: #5bc0de;
background: url('../images/bg2.jpg') fixed no-repeat;
background-size: 100% 100%;
}
.container {
background: url('../images/bg3.png') no-repeat;
background-size: contain;
width: 704px;
height: 404px;
margin: 0 auto;
margin-top: calc(100vh / 2 - 190px);
}
}