modified: begushiybashkir/bbvue/src/views/Profile.vue

some fix?
This commit is contained in:
2025-10-12 07:33:02 +05:00
parent 237ee6742e
commit 8447dbe882
+10 -7
View File
@@ -6,9 +6,7 @@
<div v-else-if="user" class="profile-content"> <div v-else-if="user" class="profile-content">
<div class="profile-header"> <div class="profile-header">
<img :src="getImageUrl('dinamo.jpg')" <img :src="getImageUrl('dinamo.jpg')" alt="Аватар" style="width: 100px; height: 100px; border-radius: 50%;">
alt="Аватар"
style="width: 100px; height: 100px; border-radius: 50%;">
<h2>{{ user.firstName }} {{ user.lastName }}</h2> <h2>{{ user.firstName }} {{ user.lastName }}</h2>
<p>Участник с {{ joinDate }}</p> <p>Участник с {{ joinDate }}</p>
<p class="user-email">{{ user.email }}</p> <p class="user-email">{{ user.email }}</p>
@@ -191,19 +189,24 @@ export default {
async loadStats() { async loadStats() {
this.statsLoading = true this.statsLoading = true
try { try {
await Promise.all([ const [statsResult, achievementsResult] = await Promise.all([
this.userStore.fetchUserStats(), this.userStore.fetchUserStats(),
this.userStore.fetchUserAchievements() this.userStore.fetchUserAchievements()
]) ])
// Проверяем результаты
if (!statsResult.success) {
console.error('Ошибка загрузки статистики:', statsResult.error)
}
if (!achievementsResult.success) {
console.error('Ошибка загрузки достижений:', achievementsResult.error)
}
} catch (error) { } catch (error) {
console.error('Ошибка загрузки статистики:', error) console.error('Ошибка загрузки статистики:', error)
} finally { } finally {
this.statsLoading = false this.statsLoading = false
} }
}, },
async refreshStats() {
await this.loadStats()
},
async handleLogout() { async handleLogout() {
await this.authStore.logout() await this.authStore.logout()
this.$router.push('/login') this.$router.push('/login')