add training photo into begushiybashkir site
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 218 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 174 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 171 KiB |
@@ -246,6 +246,9 @@ export default {
|
||||
{ src: 'slider/slider5.jpg', alt: 'Соревнования', date: 'Ноябрь 2024', category: 'events' },
|
||||
{ src: 'slider/slider6.jpg', alt: 'Награждение', date: 'Ноябрь 2024', category: 'events' },
|
||||
{ src: 'slider/slider7.jpg', alt: 'Командный дух', date: 'Октябрь 2024', category: 'community' },
|
||||
{ src: 'slider/workout1.jpg', alt: 'Тренировка на набережной', date: 'Октябрь 2025', category: 'training' },
|
||||
{ src: 'slider/workout2.jpg', alt: 'Тренировка на набережной', date: 'Октябрь 2025', category: 'training' },
|
||||
{ src: 'slider/workout3.jpg', alt: 'Тренировка на набережной', date: 'Октябрь 2025', category: 'training' },
|
||||
{ src: 'slider/slider8.jpg', alt: 'Вечерняя пробежка', date: 'Октябрь 2024', category: 'training' },
|
||||
{ src: 'slider/slider9.jpg', alt: 'Растяжка после бега', date: 'Октябрь 2024', category: 'training' },
|
||||
{ src: 'slider/slider10.jpg', alt: 'Общение после тренировки', date: 'Сентябрь 2024', category: 'community' },
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import axios from 'axios';
|
||||
|
||||
const instance = axios.create({
|
||||
baseURL: 'http://yalarba.ru',
|
||||
baseURL: 'http://yalarba.ru/api/v1/',
|
||||
withCredentials: true, // Это важно для работы с HTTP-only куки
|
||||
});
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import AuthService from '../services/auth.service.js';
|
||||
import { jwtDecode } from 'jwt-decode';
|
||||
|
||||
export const useAuthStore = defineStore('auth', () => {
|
||||
const user = reactive({username: '', email: '', id: 0, token: ''});
|
||||
const user = reactive({name: '', email: '', id: 0, token: ''});
|
||||
const isAuthenticated = ref(false);
|
||||
|
||||
// Восстановление из localStorage при инициализации
|
||||
@@ -17,7 +17,7 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
try {
|
||||
user.token = storedToken;
|
||||
const userData = JSON.parse(storedUser);
|
||||
user.username = userData.username;
|
||||
user.name = userData.name;
|
||||
user.email = userData.email;
|
||||
user.id = userData.id;
|
||||
isAuthenticated.value = true;
|
||||
@@ -39,7 +39,8 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
// Если сервер возвращает токен при регистрации
|
||||
if (response.token) {
|
||||
const decodedToken = jwtDecode(response.token);
|
||||
user.username = decodedToken.user?.username || userData.name;
|
||||
alert(decodedToken.name)
|
||||
user.name = decodedToken.user?.name || userData.name;
|
||||
user.id = decodedToken.user?.id || 0;
|
||||
user.email = decodedToken.user?.email || userData.email;
|
||||
isAuthenticated.value = true;
|
||||
@@ -48,7 +49,7 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
// Сохраняем в localStorage
|
||||
localStorage.setItem('token', response.token);
|
||||
localStorage.setItem('user', JSON.stringify({
|
||||
username: user.username,
|
||||
username: user.name,
|
||||
email: user.email,
|
||||
id: user.id
|
||||
}));
|
||||
@@ -65,7 +66,7 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
try {
|
||||
const response = await AuthService.login(credentials);
|
||||
const decodedToken = jwtDecode(response.token);
|
||||
user.username = decodedToken.user?.username || '';
|
||||
user.name = decodedToken.user?.name || '';
|
||||
user.id = decodedToken.user?.id || 0;
|
||||
user.email = decodedToken.user?.email || credentials.email;
|
||||
isAuthenticated.value = true;
|
||||
@@ -74,7 +75,7 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
// Сохраняем в localStorage
|
||||
localStorage.setItem('token', response.token);
|
||||
localStorage.setItem('user', JSON.stringify({
|
||||
username: user.username,
|
||||
name: user.name,
|
||||
email: user.email,
|
||||
id: user.id
|
||||
}));
|
||||
@@ -87,7 +88,7 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
|
||||
const logout = () => {
|
||||
isAuthenticated.value = false;
|
||||
user.username = '';
|
||||
user.name = '';
|
||||
user.token = '';
|
||||
user.email = '';
|
||||
user.id = 0;
|
||||
@@ -104,7 +105,7 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
try {
|
||||
const response = await AuthService.checkAuth(token);
|
||||
// Обновляем данные пользователя
|
||||
user.username = response.user?.username || user.username;
|
||||
user.name = response.user?.name || user.name;
|
||||
user.id = response.user?.id || user.id;
|
||||
user.email = response.user?.email || user.email;
|
||||
isAuthenticated.value = true;
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
{{ t('messages.inout.login') }}
|
||||
</button>
|
||||
</form>
|
||||
<router-link to="registration" class="toRegistration">to Registration</router-link>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -145,4 +146,26 @@ button {
|
||||
button:hover {
|
||||
box-shadow: 0 0 6px #609f7d;
|
||||
}
|
||||
|
||||
.toRegistration {
|
||||
display: inline-block;
|
||||
margin-top: 1rem;
|
||||
padding: 0.5rem 1.5rem;
|
||||
background-color: transparent;
|
||||
color: var(--text-color);
|
||||
border: 1px solid rgba(96, 159, 125, 0.5);
|
||||
border-radius: 1rem;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
font-size: 0.9rem;
|
||||
transition: all 0.3s ease;
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.toRegistration:hover {
|
||||
opacity: 1;
|
||||
box-shadow: 0 0 4px rgba(96, 159, 125, 0.4);
|
||||
background-color: rgba(96, 159, 125, 0.05);
|
||||
text-decoration: none;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user