Browse Source

[Feature][UI Next] Add navbar username. (#8108)

3.0.0/version-upgrade
songjianet 3 years ago committed by GitHub
parent
commit
5f2aa79c09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      dolphinscheduler-ui-next/src/layouts/content/components/user/index.tsx

10
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({
<NIcon class={styles.icon}>
<UserOutlined />
</NIcon>
admin
{(this.userStore.getUserInfo as UserInfoRes).userName}
<NIcon class={styles.icon}>
<DownOutlined />
</NIcon>

Loading…
Cancel
Save