로그인 한 user 프로필 가져옴
This commit is contained in:
parent
30a111c8e0
commit
81d68ea2f1
@ -12,10 +12,10 @@
|
|||||||
<button class="btn p-1" @click="switchToLightMode"><i class='bx bxs-sun link-warning'></i></button>
|
<button class="btn p-1" @click="switchToLightMode"><i class='bx bxs-sun link-warning'></i></button>
|
||||||
<button class="btn p-1" @click="switchToDarkMode"><i class='bx bxs-moon' ></i></button>
|
<button class="btn p-1" @click="switchToDarkMode"><i class='bx bxs-moon' ></i></button>
|
||||||
|
|
||||||
<i class="bx bx-bell bx-md bx-log-out cursor-pointer" @click="handleLogout"></i>
|
<i class="bx bx-bell bx-md bx-log-out cursor-pointer p-1" @click="handleLogout"></i>
|
||||||
|
|
||||||
<!-- Notification -->
|
<!-- Notification -->
|
||||||
<li class="nav-item dropdown-notifications navbar-dropdown dropdown me-3 me-xl-2">
|
<li class="nav-item dropdown-notifications navbar-dropdown dropdown me-3 me-xl-2 p-1">
|
||||||
<a
|
<a
|
||||||
class="nav-link dropdown-toggle hide-arrow"
|
class="nav-link dropdown-toggle hide-arrow"
|
||||||
href="javascript:void(0);"
|
href="javascript:void(0);"
|
||||||
@ -137,120 +137,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="list-group-item list-group-item-action dropdown-notifications-item marked-as-read">
|
|
||||||
<div class="d-flex">
|
|
||||||
<div class="flex-shrink-0 me-3">
|
|
||||||
<div class="avatar">
|
|
||||||
<img src="/img/avatars/9.png" class="rounded-circle" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex-grow-1">
|
|
||||||
<h6 class="small mb-0">Application has been approved 🚀</h6>
|
|
||||||
<small class="mb-1 d-block text-body">Your ABC project application has been approved.</small>
|
|
||||||
<small class="text-muted">2 days ago</small>
|
|
||||||
</div>
|
|
||||||
<div class="flex-shrink-0 dropdown-notifications-actions">
|
|
||||||
<a href="javascript:void(0)" class="dropdown-notifications-read"
|
|
||||||
><span class="badge badge-dot"></span
|
|
||||||
></a>
|
|
||||||
<a href="javascript:void(0)" class="dropdown-notifications-archive"
|
|
||||||
><span class="bx bx-x"></span
|
|
||||||
></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
<li class="list-group-item list-group-item-action dropdown-notifications-item marked-as-read">
|
|
||||||
<div class="d-flex">
|
|
||||||
<div class="flex-shrink-0 me-3">
|
|
||||||
<div class="avatar">
|
|
||||||
<span class="avatar-initial rounded-circle bg-label-success"
|
|
||||||
><i class="bx bx-pie-chart-alt"></i
|
|
||||||
></span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex-grow-1">
|
|
||||||
<h6 class="small mb-0">Monthly report is generated</h6>
|
|
||||||
<small class="mb-1 d-block text-body">July monthly financial report is generated </small>
|
|
||||||
<small class="text-muted">3 days ago</small>
|
|
||||||
</div>
|
|
||||||
<div class="flex-shrink-0 dropdown-notifications-actions">
|
|
||||||
<a href="javascript:void(0)" class="dropdown-notifications-read"
|
|
||||||
><span class="badge badge-dot"></span
|
|
||||||
></a>
|
|
||||||
<a href="javascript:void(0)" class="dropdown-notifications-archive"
|
|
||||||
><span class="bx bx-x"></span
|
|
||||||
></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
<li class="list-group-item list-group-item-action dropdown-notifications-item marked-as-read">
|
|
||||||
<div class="d-flex">
|
|
||||||
<div class="flex-shrink-0 me-3">
|
|
||||||
<div class="avatar">
|
|
||||||
<img src="/img/avatars/5.png" class="rounded-circle" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex-grow-1">
|
|
||||||
<h6 class="small mb-0">Send connection request</h6>
|
|
||||||
<small class="mb-1 d-block text-body">Peter sent you connection request</small>
|
|
||||||
<small class="text-muted">4 days ago</small>
|
|
||||||
</div>
|
|
||||||
<div class="flex-shrink-0 dropdown-notifications-actions">
|
|
||||||
<a href="javascript:void(0)" class="dropdown-notifications-read"
|
|
||||||
><span class="badge badge-dot"></span
|
|
||||||
></a>
|
|
||||||
<a href="javascript:void(0)" class="dropdown-notifications-archive"
|
|
||||||
><span class="bx bx-x"></span
|
|
||||||
></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
<li class="list-group-item list-group-item-action dropdown-notifications-item">
|
|
||||||
<div class="d-flex">
|
|
||||||
<div class="flex-shrink-0 me-3">
|
|
||||||
<div class="avatar">
|
|
||||||
<img src="/img/avatars/6.png" class="rounded-circle" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex-grow-1">
|
|
||||||
<h6 class="small mb-0">New message from Jane</h6>
|
|
||||||
<small class="mb-1 d-block text-body">Your have new message from Jane</small>
|
|
||||||
<small class="text-muted">5 days ago</small>
|
|
||||||
</div>
|
|
||||||
<div class="flex-shrink-0 dropdown-notifications-actions">
|
|
||||||
<a href="javascript:void(0)" class="dropdown-notifications-read"
|
|
||||||
><span class="badge badge-dot"></span
|
|
||||||
></a>
|
|
||||||
<a href="javascript:void(0)" class="dropdown-notifications-archive"
|
|
||||||
><span class="bx bx-x"></span
|
|
||||||
></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
<li class="list-group-item list-group-item-action dropdown-notifications-item marked-as-read">
|
|
||||||
<div class="d-flex">
|
|
||||||
<div class="flex-shrink-0 me-3">
|
|
||||||
<div class="avatar">
|
|
||||||
<span class="avatar-initial rounded-circle bg-label-warning"
|
|
||||||
><i class="bx bx-error"></i
|
|
||||||
></span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex-grow-1">
|
|
||||||
<h6 class="small mb-0">CPU is running high</h6>
|
|
||||||
<small class="mb-1 d-block text-body">CPU Utilization Percent is currently at 88.63%,</small>
|
|
||||||
<small class="text-muted">5 days ago</small>
|
|
||||||
</div>
|
|
||||||
<div class="flex-shrink-0 dropdown-notifications-actions">
|
|
||||||
<a href="javascript:void(0)" class="dropdown-notifications-read"
|
|
||||||
><span class="badge badge-dot"></span
|
|
||||||
></a>
|
|
||||||
<a href="javascript:void(0)" class="dropdown-notifications-archive"
|
|
||||||
><span class="bx bx-x"></span
|
|
||||||
></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li class="border-top">
|
<li class="border-top">
|
||||||
@ -266,9 +152,7 @@
|
|||||||
<!-- User -->
|
<!-- User -->
|
||||||
<li class="nav-item navbar-dropdown dropdown-user dropdown">
|
<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">
|
<a class="nav-link dropdown-toggle hide-arrow p-0" href="javascript:void(0);" data-bs-toggle="dropdown">
|
||||||
<div class="avatar avatar-online">
|
<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 src="/img/avatars/1.png" class="w-px-40 h-auto rounded-circle" />
|
|
||||||
</div>
|
|
||||||
</a>
|
</a>
|
||||||
<ul class="dropdown-menu dropdown-menu-end">
|
<ul class="dropdown-menu dropdown-menu-end">
|
||||||
<li>
|
<li>
|
||||||
@ -344,26 +228,37 @@
|
|||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useAuthStore } from '@s/useAuthStore';
|
import { useAuthStore } from '@s/useAuthStore';
|
||||||
|
import { useUserStore } from '@s/useUserStore';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import { useThemeStore } from '@s/darkmode';
|
import { useThemeStore } from '@s/darkmode';
|
||||||
import { onMounted } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
|
|
||||||
|
const user = ref(null);
|
||||||
|
|
||||||
const authStore = useAuthStore();
|
const authStore = useAuthStore();
|
||||||
|
const userStore = useUserStore();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
const { isDarkMode, switchToDarkMode, switchToLightMode } = useThemeStore();
|
const { isDarkMode, switchToDarkMode, switchToLightMode } = useThemeStore();
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(async () => {
|
||||||
if (isDarkMode) {
|
if (isDarkMode) {
|
||||||
switchToDarkMode();
|
switchToDarkMode();
|
||||||
} else {
|
} else {
|
||||||
switchToLightMode();
|
switchToLightMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await userStore.userInfo();
|
||||||
|
user.value = userStore.user;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const handleLogout = async () => {
|
const handleLogout = async () => {
|
||||||
await authStore.logout();
|
await authStore.logout();
|
||||||
router.push('/login');
|
router.push('/login');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style></style>
|
<style></style>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user