diff --git a/API/app/main.py b/API/app/main.py
index 808a764..8d351b0 100644
--- a/API/app/main.py
+++ b/API/app/main.py
@@ -15,7 +15,7 @@ def start_app():
api_app.add_middleware(
CORSMiddleware,
- allow_origins=["*"],
+ allow_origins=["http://localhost:5173"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
diff --git a/WEB/src/pages/HomePage.vue b/WEB/src/pages/HomePage.vue
index 9262e47..b522d70 100644
--- a/WEB/src/pages/HomePage.vue
+++ b/WEB/src/pages/HomePage.vue
@@ -1,11 +1,44 @@
-12345
+
+
Добро пожаловать!
+
+
+
+
+
+
+
+
\ No newline at end of file
+.home-page {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ min-height: 100vh;
+ gap: 20px;
+}
+
diff --git a/WEB/src/pages/LoginPage.vue b/WEB/src/pages/LoginPage.vue
index f6e8ffa..ba483f6 100644
--- a/WEB/src/pages/LoginPage.vue
+++ b/WEB/src/pages/LoginPage.vue
@@ -1,19 +1,41 @@
-
-
-
+
+
- Вход
+
+
+
+
+ Добро пожаловать
+
+
+
+ Добро пожаловать
+
+
+
@@ -56,27 +98,46 @@ const authorisation = async () => {
dense
outlined
autofocus
- class="q-mb-md"
+ class="q-mb-md lavender-input"
lazy-rules="ondemand"
:rules="[ val => (val && val.length > 0) || 'Введите логин' ]"
- />
+ :disable="loading"
+ rounded
+ color="deep-purple-5"
+ >
+
+
+
+
+ :disable="loading"
+ rounded
+ color="deep-purple-5"
+ >
+
+
+
+
@@ -85,7 +146,122 @@ const authorisation = async () => {
diff --git a/WEB/src/router/index.js b/WEB/src/router/index.js
index 1b89a3f..6011359 100644
--- a/WEB/src/router/index.js
+++ b/WEB/src/router/index.js
@@ -1,20 +1,13 @@
import {createRouter, createWebHistory} from 'vue-router'
-// import DashboardPage from '@/pages/DashboardPage.vue'
-import LoginPage from "../pages/LoginPage.vue";
-import HomePage from "../pages/HomePage.vue"; // пример
+import LoginPage from "../pages/LoginPage.vue"
+import HomePage from "../pages/HomePage.vue"
const routes = [
{
- path: '/', component: HomePage,
- meta: {requiresAuth: true}
+ path: '/',
+ component: HomePage
},
-
- {path: '/login', component: LoginPage},
- // {
- // path: '/dashboard',
- // component: DashboardPage,
- // meta: { requiresAuth: true } // требовать авторизацию
- // }
+ {path: '/login', component: LoginPage}
]
const router = createRouter({
@@ -22,14 +15,11 @@ const router = createRouter({
routes
})
-// Навешиваем перехватчик навигации
router.beforeEach((to, from, next) => {
const isAuthenticated = !!localStorage.getItem('access_token')
- if (to.meta.requiresAuth && !isAuthenticated) {
- next('/login')
- } else if (to.path === '/login' && isAuthenticated) {
- next('/dashboard')
+ if (to.path === '/login' && isAuthenticated) {
+ next('/') // теперь редирект на главную страницу
} else {
next()
}