feat: 登录首页增加切换功能

This commit is contained in:
Argo-Tianyi 2022-01-27 16:00:21 +08:00 committed by zhangpeihang
parent 84422250c6
commit 955f65a7aa
3 changed files with 17 additions and 2 deletions

View File

@ -1,4 +1,4 @@
<div class="wrap">
<div class="wrap white">
<div class="container">
<form method="post" class="form-signin" action="@PostUrl" @ref="LoginForm">
<h2 class="form-signin-heading">@Title</h2>

View File

@ -18,3 +18,7 @@ li {
li:not(:last-child) {
margin-right: 1rem;
}
.white + .login-footer li a {
color: #fff;
}

View File

@ -31,6 +31,13 @@ public class Login : ComponentBase
[Parameter]
public string? AppId { get; set; }
/// <summary>
///
/// </summary>
[SupplyParameterFromQuery]
[Parameter]
public string? View { get; set; }
[Inject]
[NotNull]
private IDict? DictsService { get; set; }
@ -41,7 +48,11 @@ public class Login : ComponentBase
/// <param name="builder"></param>
protected override void BuildRenderTree(RenderTreeBuilder builder)
{
var view = LoginHelper.GetCurrentLoginTheme(DictsService.GetCurrentLogin());
if (!string.IsNullOrEmpty(View))
{
View = $"0-{View}";
}
var view = LoginHelper.GetCurrentLoginTheme(View ?? DictsService.GetCurrentLogin());
var componentType = view switch
{
"gitee" => typeof(AdminLoginGitee),