|
|
@@ -0,0 +1,31 @@
|
|
|
+<template>
|
|
|
+ <a-dropdown trigger="hover" @select="handleSelect">
|
|
|
+ <div class="header-right-profile">
|
|
|
+ <span>{{ currentUser.name }}</span>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <template #content>
|
|
|
+ <a-doption value="logout"><icon-export />{{ $t('login.logout') }}</a-doption>
|
|
|
+ </template>
|
|
|
+ </a-dropdown>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import { useRouter } from 'vue-router';
|
|
|
+import { useCurrentUserStore } from '../../../base/store/use-current-user';
|
|
|
+
|
|
|
+const router = useRouter();
|
|
|
+
|
|
|
+const currentUser = useCurrentUserStore();
|
|
|
+
|
|
|
+const handleSelect = (value) => {
|
|
|
+ console.log(value, '退出登录');
|
|
|
+
|
|
|
+ router.push({ path: '/login', replace: true });
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="css" scoped>
|
|
|
+.header-right-profile {
|
|
|
+}
|
|
|
+</style>
|