From 5f2aa79c09bfc6e6da47cca840caed1af8a2727f Mon Sep 17 00:00:00 2001
From: songjianet <1778651752@qq.com>
Date: Tue, 18 Jan 2022 21:28:49 +0800
Subject: [PATCH] [Feature][UI Next] Add navbar username. (#8108)
---
.../src/layouts/content/components/user/index.tsx | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/dolphinscheduler-ui-next/src/layouts/content/components/user/index.tsx b/dolphinscheduler-ui-next/src/layouts/content/components/user/index.tsx
index 4cc2a926c2..dc795d190b 100644
--- a/dolphinscheduler-ui-next/src/layouts/content/components/user/index.tsx
+++ b/dolphinscheduler-ui-next/src/layouts/content/components/user/index.tsx
@@ -17,9 +17,11 @@
import { defineComponent, PropType } from 'vue'
import { NDropdown, NIcon, NButton } from 'naive-ui'
-import styles from './index.module.scss'
import { DownOutlined, UserOutlined } from '@vicons/antd'
import { useDropDown } from './use-dropdown'
+import { useUserStore } from '@/store/user/user'
+import styles from './index.module.scss'
+import type { UserInfoRes } from '@/service/modules/users/types'
const User = defineComponent({
name: 'User',
@@ -31,7 +33,9 @@ const User = defineComponent({
},
setup() {
const { handleSelect } = useDropDown()
- return { handleSelect }
+ const userStore = useUserStore()
+
+ return { handleSelect, userStore }
},
render() {
return (
@@ -45,7 +49,7 @@ const User = defineComponent({
- admin
+ {(this.userStore.getUserInfo as UserInfoRes).userName}