diff --git a/packages/shared/src/layouts/BasicLayout.vue b/packages/shared/src/layouts/BasicLayout.vue index eccb360f..1c7bc049 100644 --- a/packages/shared/src/layouts/BasicLayout.vue +++ b/packages/shared/src/layouts/BasicLayout.vue @@ -9,6 +9,7 @@ import { VTag, } from "@halo-dev/components"; import type { MenuGroupType, MenuItemType } from "@/types/menus"; +import type { User } from "../../../../src/types/extension"; import logo from "@/assets/logo.svg"; import { RouterView, useRoute, useRouter } from "vue-router"; import { inject, ref } from "vue"; @@ -22,8 +23,10 @@ const moreMenuVisible = ref(false); const moreMenuRootVisible = ref(false); const spotlight = ref(false); +const currentUser = inject("currentUser"); + const handleRouteToProfile = () => { - router.push({ path: "/users/profile/detail" }); + router.push({ path: `/users/${currentUser?.metadata.name}/detail` }); }; @@ -47,11 +50,13 @@ const handleRouteToProfile = () => {
-
- +
+
-
Ryan Wang
+
+ {{ currentUser.spec.displayName }} +