- 移除 `UserInfoController`,新增 `UserControllers` 使用 `UserService` - 添加 `UserService` 用于处理用户信息 - 新增 `UserProfile` DTO - 添加数据库迁移以支持用户表结构
83 lines
3.5 KiB
Plaintext
83 lines
3.5 KiB
Plaintext
@page
|
|
@model LoginModel
|
|
|
|
@{
|
|
ViewData["Title"] = "登录";
|
|
}
|
|
|
|
<h1>@ViewData["Title"]</h1>
|
|
<div class="row">
|
|
<div class="col-md-4">
|
|
<section>
|
|
<form id="account" method="post">
|
|
<h2>使用本地账户登录。</h2>
|
|
<hr />
|
|
<div asp-validation-summary="ModelOnly" class="text-danger" role="alert"></div>
|
|
<div class="form-floating mb-3">
|
|
<input asp-for="Input.Email" class="form-control" autocomplete="username" aria-required="true" placeholder="name@example.com" />
|
|
<label asp-for="Input.Email" class="form-label">电子邮件</label>
|
|
<span asp-validation-for="Input.Email" class="text-danger"></span>
|
|
</div>
|
|
<div class="form-floating mb-3">
|
|
<input asp-for="Input.Password" class="form-control" autocomplete="current-password" aria-required="true" placeholder="password" />
|
|
<label asp-for="Input.Password" class="form-label">密码</label>
|
|
<span asp-validation-for="Input.Password" class="text-danger"></span>
|
|
</div>
|
|
<div class="checkbox mb-3">
|
|
<label asp-for="Input.RememberMe" class="form-label">
|
|
<input class="form-check-input" asp-for="Input.RememberMe" />
|
|
记住我
|
|
</label>
|
|
</div>
|
|
<div>
|
|
<button id="login-submit" type="submit" class="w-100 btn btn-lg btn-primary">登录</button>
|
|
</div>
|
|
<div>
|
|
<p>
|
|
<a id="forgot-password" asp-page="./ForgotPassword">忘记密码?</a>
|
|
</p>
|
|
<p>
|
|
<a asp-page="./Register" asp-route-returnUrl="@Model.ReturnUrl">注册为新用户</a>
|
|
</p>
|
|
<p>
|
|
<a id="resend-confirmation" asp-page="./ResendEmailConfirmation">重新发送电子邮件确认</a>
|
|
</p>
|
|
</div>
|
|
</form>
|
|
</section>
|
|
</div>
|
|
<div class="col-md-6 col-md-offset-2">
|
|
<section>
|
|
<h3>使用其他服务登录。</h3>
|
|
<hr />
|
|
@{
|
|
if ((Model.ExternalLogins?.Count ?? 0) == 0)
|
|
{
|
|
<div>
|
|
<p>
|
|
没有配置外部身份验证服务。请参阅<a href="https://go.microsoft.com/fwlink/?LinkID=532715">关于设置此ASP.NET应用程序以支持通过外部服务登录的文章</a>。
|
|
</p>
|
|
</div>
|
|
}
|
|
else
|
|
{
|
|
<form id="external-account" asp-page="./ExternalLogin" asp-route-returnUrl="@Model.ReturnUrl" method="post" class="form-horizontal">
|
|
<div>
|
|
<p>
|
|
@foreach (var provider in Model.ExternalLogins!)
|
|
{
|
|
<button type="submit" class="btn btn-primary" name="provider" value="@provider.Name" title="Log in using your @provider.DisplayName account">@provider.DisplayName</button>
|
|
}
|
|
</p>
|
|
</div>
|
|
</form>
|
|
}
|
|
}
|
|
</section>
|
|
</div>
|
|
</div>
|
|
|
|
@section Scripts {
|
|
<partial name="_ValidationScriptsPartial" />
|
|
}
|