feat: 增加登录首页切换功能
This commit is contained in:
parent
6e881fbff4
commit
2674c6278d
|
@ -1,4 +1,4 @@
|
|||
<div class="wrap">
|
||||
<div class="@LoginClassString">
|
||||
<div class="container">
|
||||
<form method="post" class="form-signin" action="@PostUrl" @ref="LoginForm">
|
||||
<h2 class="form-signin-heading">@Title</h2>
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
// Website: https://admin.blazor.zone
|
||||
|
||||
using BootstrapAdmin.Web.Core;
|
||||
using BootstrapAdmin.Web.Utils;
|
||||
using Microsoft.JSInterop;
|
||||
|
||||
namespace BootstrapAdmin.Web.Components;
|
||||
|
@ -66,10 +67,16 @@ public partial class AdminLogin : IDisposable
|
|||
[NotNull]
|
||||
private IIPLocatorProvider? IPLocatorProvider { get; set; }
|
||||
|
||||
private string? LoginView { get; set; }
|
||||
|
||||
private string? ClassString => CssBuilder.Default("login-wrap")
|
||||
.AddClass("is-mobile", UseMobileLogin)
|
||||
.Build();
|
||||
|
||||
private string? LoginClassString => CssBuilder.Default("wrap")
|
||||
.AddClass(LoginView)
|
||||
.Build();
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
|
@ -77,6 +84,7 @@ public partial class AdminLogin : IDisposable
|
|||
{
|
||||
base.OnInitialized();
|
||||
|
||||
LoginView = LoginHelper.GetCurrentLoginTheme(DictsService.GetCurrentLogin());
|
||||
Title = DictsService.GetWebTitle();
|
||||
PostUrl = QueryHelper.AddQueryString("Account/Login", new Dictionary<string, string?>
|
||||
{
|
||||
|
|
|
@ -50,4 +50,20 @@ public static class LoginHelper
|
|||
|
||||
return returnUrl ?? "/Admin/Index";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将字典表中的配置 1-Login-Gitee 转化为 gitee
|
||||
/// </summary>
|
||||
/// <param name="loginTheme"></param>
|
||||
/// <returns></returns>
|
||||
public static string? GetCurrentLoginTheme(string loginTheme)
|
||||
{
|
||||
string? ret = null;
|
||||
var segs = loginTheme.Split('-');
|
||||
if (segs.Length == 3)
|
||||
{
|
||||
ret = segs[2].ToLowerInvariant();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue