modified: begushiybashkir/bbvue/src/views/Reviews.vue
fix bags with button cta and when login state can't set reviews
This commit is contained in:
@@ -406,15 +406,26 @@ export default {
|
||||
|
||||
async checkAuth() {
|
||||
try {
|
||||
const token = localStorage.getItem('token')
|
||||
const token = localStorage.getItem('auth_token') // Используем auth_token вместо token
|
||||
if (token) {
|
||||
// Проверяем токен через API или декодируем
|
||||
this.isAuthenticated = true
|
||||
// Загружаем информацию о пользователе если нужно
|
||||
// Пробуем получить профиль для проверки токена
|
||||
try {
|
||||
const response = await apiClient.get('/user/profile')
|
||||
this.isAuthenticated = true
|
||||
this.currentUser = response.data
|
||||
} catch (error) {
|
||||
// Если запрос профиля失敗, считаем неавторизованным
|
||||
console.error('Токен невалиден:', error)
|
||||
this.isAuthenticated = false
|
||||
localStorage.removeItem('auth_token')
|
||||
}
|
||||
} else {
|
||||
this.isAuthenticated = false
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Ошибка проверки авторизации:', error)
|
||||
this.isAuthenticated = false
|
||||
localStorage.removeItem('auth_token')
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1291,13 +1302,13 @@ export default {
|
||||
|
||||
.btn-secondary {
|
||||
background: transparent;
|
||||
color: white;
|
||||
border-color: white;
|
||||
color: rgb(162, 224, 198); /* Белый текст */
|
||||
border-color: white; /* Белая рамка */
|
||||
}
|
||||
|
||||
.btn-secondary:hover {
|
||||
background: white;
|
||||
color: #2e8b57;
|
||||
color: #2e8b57; /* Зеленый текст при hover */
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
@@ -1619,4 +1630,5 @@ textarea:focus-visible {
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user