src/Web/WebMVC/Views/Shared/_LoginPartial.cshtml

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

@using Microsoft.AspNetCore.Identity
@using Microsoft.eShopOnContainers.WebMVC.ViewModels
@using Microsoft.eShopOnContainers.WebMVC.Services

@inject IIdentityParser<ApplicationUser> UserManager

@*@if (Context.User.Identity.IsAuthenticated)*@
@if (User.FindFirst(x => x.Type == "preferred_username") != null)
{
    <section class="col-lg-4 col-md-5 col-xs-12">
        <div class="esh-identity">
            <form asp-area="" asp-controller="Account" asp-action="SignOut" method="post" id="logoutForm" class="navbar-right">
                <section class="esh-identity-section">

                    <div class="esh-identity-name">@User.FindFirst(x => x.Type == "preferred_username").Value</div>
                    <img class="esh-identity-image" src="~/images/arrow-down.png">
                </section>

                <section class="esh-identity-drop">

                    <a class="esh-identity-item"
                       asp-controller="Order"
                       asp-action="Index">

                        <div class="esh-identity-name esh-identity-name--upper">My orders</div>
                        <img class="esh-identity-image" src="~/images/my_orders.png">
                    </a>

                    <a class="esh-identity-item"
                       href="javascript:document.getElementById('logoutForm').submit()">

                        <div class="esh-identity-name esh-identity-name--upper">Log Out</div>
                        <img class="esh-identity-image" src="~/images/logout.png">
                    </a>
                </section>
            </form>
        </div>
    </section>

    <section class="col-lg-1 col-xs-12">
        @await Component.InvokeAsync("Cart", new { user = UserManager.Parse(User) })
    </section>

}
else
{
    <section class="col-lg-4 col-md-5 col-xs-12">
        <div class="esh-identity">
            <section class="esh-identity-section">
                <div class="esh-identity-item">

                    <a asp-area="" asp-controller="Account" asp-action="SignIn" class="esh-identity-name esh-identity-name--upper">
                        Login
                    </a>
                </div>
            </section>
        </div>
    </section>

    <section class="col-lg-1 col-xs-12">
后面还有 3 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。