- 移除 `UserInfoController`,新增 `UserControllers` 使用 `UserService` - 添加 `UserService` 用于处理用户信息 - 新增 `UserProfile` DTO - 添加数据库迁移以支持用户表结构
67 lines
2.9 KiB
Plaintext
67 lines
2.9 KiB
Plaintext
@page
|
|
@model RegisterModel
|
|
@{
|
|
ViewData["Title"] = "注册";
|
|
}
|
|
|
|
<h1>注册</h1>
|
|
|
|
<div class="row">
|
|
<div class="col-md-4">
|
|
<form id="registerForm" asp-route-returnUrl="@Model.ReturnUrl" 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">电子邮件</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="new-password" aria-required="true" placeholder="password" />
|
|
<label asp-for="Input.Password">密码</label>
|
|
<span asp-validation-for="Input.Password" class="text-danger"></span>
|
|
</div>
|
|
<div class="form-floating mb-3">
|
|
<input asp-for="Input.ConfirmPassword" class="form-control" autocomplete="new-password" aria-required="true" placeholder="password" />
|
|
<label asp-for="Input.ConfirmPassword">确认密码</label>
|
|
<span asp-validation-for="Input.ConfirmPassword" class="text-danger"></span>
|
|
</div>
|
|
<button id="registerSubmit" type="submit" class="w-100 btn btn-lg btn-primary">注册</button>
|
|
</form>
|
|
</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" />
|
|
}
|