default img 추가

This commit is contained in:
yoon 2025-02-22 14:02:05 +09:00
parent fc5f4463b1
commit ac5cf6077c
2 changed files with 5 additions and 4 deletions

View File

@ -15,8 +15,9 @@
<img
class="rounded-circle user-avatar border border-3"
:class="{ 'grayscaleImg': isUserDisabled(user) }"
:src="profilePath ? `${baseUrl}upload/img/profile/${profilePath}` : defaultProfile"
:src="`${baseUrl}upload/img/profile/${user.MEMBERPRF}`"
:style="`border-color: ${user.usercolor} !important;`"
@error="$event.target.src = '/img/icons/icon.png'"
alt="user"
/>
</li>
@ -31,9 +32,7 @@ import $api from '@api';
const emit = defineEmits(['user-list-update']);
const userStore = useUserStore();
const userList = ref([]);
const profilePath = ref(null);
const baseUrl = $api.defaults.baseURL.replace(/api\/$/, '');
const defaultProfile = "/img/icons/icon.png";
const props = defineProps({
projctSeq: {

View File

@ -152,7 +152,7 @@
<!-- User -->
<li class="nav-item navbar-dropdown dropdown-user dropdown">
<a class="nav-link dropdown-toggle hide-arrow p-0" href="javascript:void(0);" data-bs-toggle="dropdown">
<img v-if="user" :src="`http://localhost:10325/upload/img/profile/${user.profile}`" alt="Profile Image" class="w-px-40 h-auto rounded-circle"/>
<img v-if="user" :src="`${baseUrl}upload/img/profile/${user.profile}`" alt="Profile Image" class="w-px-40 h-auto rounded-circle" @error="$event.target.src = '/img/icons/icon.png'"/>
</a>
<ul class="dropdown-menu dropdown-menu-end">
<li>
@ -232,8 +232,10 @@ import { useUserInfoStore } from '@/stores/useUserInfoStore';
import { useRouter } from 'vue-router';
import { useThemeStore } from '@s/darkmode';
import { onMounted, ref } from 'vue';
import $api from '@api';
const user = ref(null);
const baseUrl = $api.defaults.baseURL.replace(/api\/$/, '');
const authStore = useAuthStore();
const userStore = useUserInfoStore();