feat: Blazor 登录日志增加登录结果格式化
This commit is contained in:
parent
79175dcbe2
commit
a9dd132586
|
@ -22,7 +22,7 @@
|
|||
<td>@context.City</td>
|
||||
<td>@context.Browser</td>
|
||||
<td>@context.OS</td>
|
||||
<td>@context.Result</td>
|
||||
<td>@FormatResult(context.Result)</td>
|
||||
</RowTemplate>
|
||||
<SearchTemplate>
|
||||
<LgbInputText ColumnClass="col-12" @bind-Value="@context.Ip" maxlength="50" />
|
||||
|
|
|
@ -42,6 +42,16 @@ namespace Bootstrap.Admin.Pages.Views.Admin.Components
|
|||
return data.ToQueryData();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 格式化登录结果方法
|
||||
/// </summary>
|
||||
protected MarkupString FormatResult(string result)
|
||||
{
|
||||
var css = result == "登录成功" ? "success" : "danger";
|
||||
var icon = css == "success" ? "check" : "remove";
|
||||
return new MarkupString($"<span class=\"badge badge-md badge-{css}\"><i class=\"fa fa-{icon}\"></i>{result}</span>");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 重置搜索方法
|
||||
/// </summary>
|
||||
|
|
Loading…
Reference in New Issue