modified: begushiybashkir/bbvue/src/views/Profile.vue
set cool path for src img avatar but not laud becouse authorization
This commit is contained in:
@@ -9,13 +9,8 @@
|
||||
<!-- Обновленная секция аватара -->
|
||||
<div class="avatar-section">
|
||||
<div class="avatar-preview">
|
||||
<img
|
||||
v-if="user.avatar"
|
||||
:src="avatarUrl"
|
||||
:alt="`Аватар ${user.firstName} ${user.lastName}`"
|
||||
class="avatar-image"
|
||||
@error="handleAvatarError"
|
||||
>
|
||||
<img v-if="user.avatar" :src="avatarUrl" :alt="`Аватар ${user.firstName} ${user.lastName}`"
|
||||
class="avatar-image" @error="handleAvatarError">
|
||||
<div v-else class="avatar-placeholder">
|
||||
👤
|
||||
</div>
|
||||
@@ -161,16 +156,12 @@ export default {
|
||||
avatarUrl() {
|
||||
if (!this.user?.avatar) return null;
|
||||
|
||||
// Если avatar уже содержит полный URL, возвращаем как есть
|
||||
if (this.user.avatar.startsWith('http')) {
|
||||
return this.user.avatar;
|
||||
}
|
||||
let filename = this.user.avatar.trim('/').split('/').pop();
|
||||
|
||||
// Иначе формируем полный URL
|
||||
const baseUrl = 'https://begushiybashkir.ru/api/v1/user';
|
||||
const baseUrl = 'https://begushiybashkir.ru/api/v1/user/avatars/';
|
||||
|
||||
alert(this.user.avatar)
|
||||
return baseUrl + this.user.avatar;
|
||||
return baseUrl + filename;
|
||||
},
|
||||
joinDate() {
|
||||
if (!this.user?.createdAt) return 'января 2024';
|
||||
@@ -343,12 +334,15 @@ export default {
|
||||
font-size: 1.8rem;
|
||||
}
|
||||
|
||||
.user-email, .user-phone {
|
||||
.user-email,
|
||||
.user-phone {
|
||||
color: #666;
|
||||
margin: 0.25rem 0;
|
||||
}
|
||||
|
||||
.profile-info, .profile-stats, .achievements-preview {
|
||||
.profile-info,
|
||||
.profile-stats,
|
||||
.achievements-preview {
|
||||
background: white;
|
||||
padding: 1.5rem;
|
||||
border-radius: 15px;
|
||||
|
||||
Reference in New Issue
Block a user