Front Client
This commit is contained in:
parent
5ed47eea9e
commit
0b7e8c20d2
@ -29,14 +29,9 @@ namespace BankYouBankruptClientApp.Controllers
|
|||||||
|
|
||||||
#region Профиль, вход и регистрация
|
#region Профиль, вход и регистрация
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public IActionResult Profile()
|
public IActionResult Enter()
|
||||||
{
|
{
|
||||||
if (APIClient.Client == null)
|
return View();
|
||||||
{
|
|
||||||
return Redirect("~/Home/Enter");
|
|
||||||
}
|
|
||||||
|
|
||||||
return View(APIClient.GetRequest<ClientViewModel>($"api/Client/GetClient?clientId={APIClient.Client.Id}"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -51,14 +46,14 @@ namespace BankYouBankruptClientApp.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public IActionResult Enter()
|
public IActionResult Login()
|
||||||
{
|
{
|
||||||
return View();
|
return View();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public void Enter(string login, string password)
|
public void Login(string login, string password)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(login) || string.IsNullOrEmpty(password))
|
if (string.IsNullOrEmpty(login) || string.IsNullOrEmpty(password))
|
||||||
{
|
{
|
||||||
@ -72,7 +67,7 @@ namespace BankYouBankruptClientApp.Controllers
|
|||||||
throw new Exception("Неверный логин/пароль");
|
throw new Exception("Неверный логин/пароль");
|
||||||
}
|
}
|
||||||
|
|
||||||
Response.Redirect("Profile");
|
Response.Redirect("Enter");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,6 +26,6 @@ app.UseAuthorization();
|
|||||||
|
|
||||||
app.MapControllerRoute(
|
app.MapControllerRoute(
|
||||||
name: "default",
|
name: "default",
|
||||||
pattern: "{controller=Home}/{action=Profile}/{id?}");
|
pattern: "{controller=Home}/{action=Enter}/{id?}");
|
||||||
|
|
||||||
app.Run();
|
app.Run();
|
||||||
|
@ -1,33 +1,22 @@
|
|||||||
@{
|
@using BankYouBankruptСlientApp
|
||||||
ViewData["Title"] = "Логин";
|
|
||||||
|
|
||||||
|
@{
|
||||||
|
ViewData["Title"] = "Страница пользователя";
|
||||||
}
|
}
|
||||||
|
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<h2 class="display-4">Вход в приложение</h2>
|
<h1 class="display-4">Страница пользователя</h1>
|
||||||
</div>
|
</div>
|
||||||
<form method="post">
|
|
||||||
<div class="row">
|
<div class="text-center">
|
||||||
<div class="col-4">Логин:</div>
|
@{
|
||||||
<div class="col-8">
|
if (APIClient.Client == null)
|
||||||
<input type="text" name="login" />
|
{
|
||||||
|
<h3 class="display-4">Сначала авторизируйтесь</h3>
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
<p>Здравствуйтe, @APIClient.Client.Name @APIClient.Client.Patronymic</p>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-4">Пароль:</div>
|
|
||||||
<div class="col-8">
|
|
||||||
<input type="password" name="password" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-8"></div>
|
|
||||||
<div class="col-4">
|
|
||||||
<input type="submit" value="Вход" class="btn btn-primary" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-8"></div>
|
|
||||||
<div class="col-4">
|
|
||||||
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="">Создать аккаунт</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
@ -0,0 +1,14 @@
|
|||||||
|
@{
|
||||||
|
ViewData["Title"] = "Логин";
|
||||||
|
}
|
||||||
|
|
||||||
|
<div class="text-center">
|
||||||
|
<h2 class="display-4">Вход в приложение</h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<form class="form-signin text-center" method="post">
|
||||||
|
<h1 class="h3 mb-3 font-weight-normal">Логин</h1>
|
||||||
|
<input type="email" id="login" name="login" class="form-control" placeholder="Почта" required autofocus>
|
||||||
|
<input type="password" id="password" name="password" class="form-control" placeholder="Пароль" required>
|
||||||
|
<button class="btn btn-lg btn-primary btn-block" type="submit" asp-controller="Home" asp-action="Login">Войти</button>
|
||||||
|
</form>
|
@ -1,23 +0,0 @@
|
|||||||
@using BankYouBankruptContracts.ViewModels.Client.Default
|
|
||||||
|
|
||||||
@model ClientViewModel
|
|
||||||
|
|
||||||
@{
|
|
||||||
ViewData["Title"] = "Страница пользователя";
|
|
||||||
}
|
|
||||||
|
|
||||||
<div class="text-center">
|
|
||||||
<h1 class="display-4">Страница пользователя</h1>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="text-center">
|
|
||||||
@{
|
|
||||||
if (Model == null)
|
|
||||||
{
|
|
||||||
<h3 class="display-4">Сначала авторизируйтесь</h3>
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
<p>Здравствуйтe, @Model.Name @Model.Patronymic</p>
|
|
||||||
}
|
|
||||||
</div>
|
|
@ -51,7 +51,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-8"></div>
|
<div class="col-8"></div>
|
||||||
<div class="col-4">
|
<div class="col-4">
|
||||||
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Enter">Уже есть аккаунт?</a>
|
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Login">Уже есть аккаунт?</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
@ -1,8 +1,5 @@
|
|||||||
@using BankYouBankruptСlientApp
|
@using BankYouBankruptСlientApp
|
||||||
|
|
||||||
@{
|
|
||||||
bool authenticated = APIClient.Client != null;
|
|
||||||
}
|
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
@ -12,46 +9,52 @@
|
|||||||
<title>@ViewData["Title"]</title>
|
<title>@ViewData["Title"]</title>
|
||||||
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
|
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
|
||||||
<link rel="stylesheet" href="~/css/site.css" />
|
<link rel="stylesheet" href="~/css/site.css" />
|
||||||
|
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css">
|
||||||
<script src="~/lib/jquery/dist/jquery.min.js"></script>
|
<script src="~/lib/jquery/dist/jquery.min.js"></script>
|
||||||
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
|
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header class="d-flex flex-wrap align-items-center justify-content-center justify-content-md-between py-3 px-4 mg-5 mb-4 border-bottom bg-dark ">
|
||||||
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
|
<div class="col-md-3 mb-2 mb-md-0">
|
||||||
<div class="container">
|
<a asp-controller="Home" asp-action="Enter" class="d-inline-flex link-body-emphasis text-decoration-none">
|
||||||
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Profile">
|
<span class="fs-4 text-light ">Банк "Вы банкрот"</span>
|
||||||
Банк "Вы банкрот"
|
|
||||||
</a>
|
</a>
|
||||||
<div class="navbar-collapse collapse d-sm-inline-flex flex-smrow-reverse">
|
</div>
|
||||||
@{ if (authenticated) {
|
|
||||||
<ul class="navbar-nav flex-grow-1">
|
<ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0 nav-main">
|
||||||
<li class="nav-item">
|
<li>
|
||||||
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="CardsList">Карты</a>
|
<a asp-controller="Home" asp-action="CardsList" class="nav-link px-2 link-light">Карты</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="dropdown">
|
||||||
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="DebitingList">Снятие средств</a>
|
<a href="#" class="nav-link px-2 link-light">Операции</a>
|
||||||
|
<ul class="dropdown-menu dropdown-menu-dark" aria-labelledby="navbarDarkDropdownMenuLink">
|
||||||
|
<li><a class="dropdown-item" asp-controller="Home" asp-action="CreditingList">Пополнить средства</a></li>
|
||||||
|
<li><a asp-controller="Home" asp-action="DebitingList" class="dropdown-item">Снять средства</a></li>
|
||||||
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="dropdown">
|
||||||
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="CreditingList">Пополнить средства</a>
|
<a href="#" class="nav-link px-2 link-light">Отчеты</a>
|
||||||
</li>
|
<ul class="dropdown-menu dropdown-menu-dark" aria-labelledby="navbarDarkDropdownMenuLink">
|
||||||
<li class="nav-item">
|
<li><a class="dropdown-item" asp-controller="Home" asp-action="CreateExcelReport">Отчет по картам</a></li>
|
||||||
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="ReportWithCards">Отчет по картам</a>
|
<li><a class="dropdown-item" asp-controller="Home" asp-action="CreateReport">Отчет за период</a></li>
|
||||||
</li>
|
<li><a class="dropdown-item" asp-controller="Home" asp-action="Diagram">Диаграмма</a></li>
|
||||||
<li class="nav-item">
|
</ul>
|
||||||
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="CreateExcelReport">Отчет Excel</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="CreateReport">Отчёт за период</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Diagram">Диаграмма</a>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@{
|
||||||
|
if (APIClient.Client == null)
|
||||||
|
{
|
||||||
|
<div class="col-md-3 text-end">
|
||||||
|
<a class="btn btn-primary me-2" asp-controller="Home" asp-action="Login">Войти</a>
|
||||||
|
<a class="btn btn-primary" asp-controller="Home" asp-action="Register">Регистрация</a>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
<div class="col-md-3 text-end">
|
||||||
|
<a class="btn btn-primary me-2" asp-controller="Home" asp-action="Enter">@APIClient.Client.Name @APIClient.Client.Surname</a>
|
||||||
|
</div>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
</header>
|
</header>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<main role="main" class="pb-3">
|
<main role="main" class="pb-3">
|
||||||
|
@ -7,9 +7,6 @@ a.navbar-brand {
|
|||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
|
||||||
color: #0077cc;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-primary {
|
.btn-primary {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
@ -47,3 +44,14 @@ button.accept-policy {
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
line-height: 60px;
|
line-height: 60px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.nav-main a {
|
||||||
|
position: relative;
|
||||||
|
color: #FFFFFF; /*задаём цвет ссылки*/
|
||||||
|
cursor: pointer;
|
||||||
|
line-height: 1; /*задаём высоту строки*/
|
||||||
|
text-decoration: none; /*убираем подчёркивание*/
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -15,4 +15,75 @@ html {
|
|||||||
|
|
||||||
body {
|
body {
|
||||||
margin-bottom: 60px;
|
margin-bottom: 60px;
|
||||||
|
background-color: #cdcdcd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-main a {
|
||||||
|
position: relative;
|
||||||
|
color: #FFFFFF;
|
||||||
|
cursor: pointer;
|
||||||
|
line-height: 1;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-main a:after {
|
||||||
|
display: block;
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
bottom: 0px;
|
||||||
|
width: 0;
|
||||||
|
height: 1px;
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
content: "";
|
||||||
|
transition: width 0.3s ease-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-main a:hover:after,
|
||||||
|
.nav-main a:focus:after {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-main .dropdown:hover .dropdown-menu {
|
||||||
|
display: block;
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
bottom: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 80px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-signin {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 330px;
|
||||||
|
padding: 15px;
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.form-signin .form-control {
|
||||||
|
position: relative;
|
||||||
|
box-sizing: border-box;
|
||||||
|
height: auto;
|
||||||
|
padding: 10px;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-signin .form-control:focus {
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-signin input[type="email"] {
|
||||||
|
margin-bottom: -1px;
|
||||||
|
border-bottom-right-radius: 0;
|
||||||
|
border-bottom-left-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-signin input[type="password"] {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
border-top-left-radius: 0;
|
||||||
|
border-top-right-radius: 0;
|
||||||
}
|
}
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user