fix(components): add logout link to navbar
This commit is contained in:
parent
e9df5cbe1a
commit
d224f43448
@ -16,6 +16,7 @@
|
|||||||
messages: "/messages",
|
messages: "/messages",
|
||||||
profile: `/user/${data?.value?.user?._id || 0}`,
|
profile: `/user/${data?.value?.user?._id || 0}`,
|
||||||
admin: "/admin",
|
admin: "/admin",
|
||||||
|
logout: "/logout",
|
||||||
};
|
};
|
||||||
let cur = ref<string>(
|
let cur = ref<string>(
|
||||||
Object.keys(itemMap).find((a) => itemMap[a] === useRoute().path) ||
|
Object.keys(itemMap).find((a) => itemMap[a] === useRoute().path) ||
|
||||||
@ -62,6 +63,7 @@
|
|||||||
<a-menu-item key="admin" v-if="data?.user?.profile.isAdmin || false">
|
<a-menu-item key="admin" v-if="data?.user?.profile.isAdmin || false">
|
||||||
Admin
|
Admin
|
||||||
</a-menu-item>
|
</a-menu-item>
|
||||||
|
<a-menu-item key="logout" v-if="!!data?.user"> Logout </a-menu-item>
|
||||||
</a-menu>
|
</a-menu>
|
||||||
<div class="acbut" v-if="!data">
|
<div class="acbut" v-if="!data">
|
||||||
<a-button size="large" @click="() => navigateTo('/login')">
|
<a-button size="large" @click="() => navigateTo('/login')">
|
||||||
|
Loading…
Reference in New Issue
Block a user