.
This commit is contained in:
parent
477f751d75
commit
5b12ab8f22
@ -87,6 +87,30 @@ namespace BankYouBankruptCashierApp.Controllers
|
|||||||
Response.Redirect("Index");
|
Response.Redirect("Index");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HttpGet]
|
||||||
|
public IActionResult Login()
|
||||||
|
{
|
||||||
|
return View();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
public void Login(string login, string password)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(login) || string.IsNullOrEmpty(password))
|
||||||
|
{
|
||||||
|
throw new Exception("Введите логин и пароль");
|
||||||
|
}
|
||||||
|
|
||||||
|
APICashier.Cashier = APICashier.GetRequest<CashierViewModel>($"api/Cashier/Login?login={login}&password={password}");
|
||||||
|
|
||||||
|
if (APICashier.Cashier == null)
|
||||||
|
{
|
||||||
|
throw new Exception("Неверный логин/пароль");
|
||||||
|
}
|
||||||
|
|
||||||
|
Response.Redirect("Enter");
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Вывод ошибок
|
#region Вывод ошибок
|
||||||
|
@ -1,27 +1,21 @@
|
|||||||
@{
|
@{
|
||||||
ViewData["Title"] = "Авторизация";
|
ViewData["Title"] = "Страница пользователя";
|
||||||
}
|
}
|
||||||
|
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<h2 class="display-4">Вход в приложение</h2>
|
<h1 class="display-4">Страница пользователя</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="text-center">
|
||||||
|
@{
|
||||||
|
<img src="~/lib/logo.png" style="width: 50%"/>
|
||||||
|
|
||||||
|
if (APICashier.Cashier == null)
|
||||||
|
{
|
||||||
|
<h3 class="display-4">Сначала авторизируйтесь</h3>
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
<p>Здравствуйтe, @APICashier.Cashier.Name @APICashier.Cashier.Patronymic</p>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
<form method="post">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-4">Логин:</div>
|
|
||||||
<div class="col-8">
|
|
||||||
<input type="text" name="login" />
|
|
||||||
</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>
|
|
||||||
</form>
|
|
@ -0,0 +1,27 @@
|
|||||||
|
@{
|
||||||
|
ViewData["Title"] = "Авторизация";
|
||||||
|
}
|
||||||
|
|
||||||
|
<div class="text-center">
|
||||||
|
<h2 class="display-4">Вход в приложение</h2>
|
||||||
|
</div>
|
||||||
|
<form method="post">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-4">Логин:</div>
|
||||||
|
<div class="col-8">
|
||||||
|
<input type="text" name="login" />
|
||||||
|
</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>
|
||||||
|
</form>
|
@ -16,58 +16,49 @@
|
|||||||
<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 class="MyBody">
|
<body class="MyBody">
|
||||||
<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" aspaction="Index">
|
<span class="fs-4 text-light ">Банк "Вы банкрот"</span>
|
||||||
Банк "Вы банкрот"
|
|
||||||
</a>
|
</a>
|
||||||
<button class="navbar-toggler" type="button" datatoggle="collapse" data-target=".navbar-collapse" ariacontrols="navbarSupportedContent"
|
</div>
|
||||||
aria-expanded="false" aria-label="Toggle navigation">
|
|
||||||
<span class="navbar-toggler-icon"></span>
|
<ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0 nav-main">
|
||||||
</button>
|
<li>
|
||||||
<div class="navbar-collapse collapse d-sm-inline-flex flex-smrow-reverse">
|
|
||||||
<ul class="navbar-nav flex-grow-1">
|
|
||||||
@{
|
|
||||||
if (authenticated)
|
|
||||||
{
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Index">Счета</a>
|
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Index">Счета</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="dropdown">
|
||||||
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Debiting">Заявки на снятие</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="Debiting">Заявки на снятие</a></li>
|
||||||
|
<li><a class="dropdown-item" asp-controller="Home" asp-action="Crediting">Заявки на начисление</a></li>
|
||||||
|
<li><a class="dropdown-item" asp-controller="Home" asp-controller="Home" asp-action="Crediting">Заявки на начисление</a></li>
|
||||||
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="dropdown">
|
||||||
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Crediting">Заявки на начисление</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-controller="Home" asp-action="ReportWithAccounts">Отчёт по аккаунтам</a></li>
|
||||||
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="MoneyTransfers">Переводы</a>
|
<li><a class="dropdown-item" asp-controller="Home" asp-controller="Home" asp-action="CreateReport">Отчёт</a></li>
|
||||||
</li>
|
<li><a class="dropdown-item" asp-controller="Home" 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="ReportWithAccounts">Отчёт по аккаунтам</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 class="nav-item">
|
|
||||||
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Privacy">Личный кабинет</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Enter">Вход</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link text-dark" asparea="" asp-controller="Home" asp-action="Register">Регистрация</a>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@{
|
||||||
|
if (APICashier.Cashier == null)
|
||||||
|
{
|
||||||
|
<div class="col-md-3 text-end">
|
||||||
|
<a class="btn btn-warning me-2" asp-controller="Home" asp-action="Login">Войти</a>
|
||||||
|
<a class="btn btn-warning" asp-controller="Home" asp-action="Register">Регистрация</a>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<div class="col-md-3 text-end">
|
||||||
|
<a class="btn btn-warning me-2" id="exit" name="exit" asp-controller="Home" asp-action="Privacy">Личный кабинет</a>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
}
|
||||||
|
}
|
||||||
</header>
|
</header>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<main role="main" class="pb-3">
|
<main role="main" class="pb-3">
|
||||||
|
@ -17,6 +17,72 @@ body {
|
|||||||
margin-bottom: 60px;
|
margin-bottom: 60px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.MyBody{
|
.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;
|
||||||
}
|
}
|
BIN
BankYouBankrupt/BankYouBankruptCashierApp/wwwroot/lib/logo.png
Normal file
BIN
BankYouBankrupt/BankYouBankruptCashierApp/wwwroot/lib/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 48 KiB |
Loading…
Reference in New Issue
Block a user