修改右上角显示用户名称

This commit is contained in:
qinjie 2021-09-10 15:55:38 +08:00
parent 2bfebe75ff
commit e06df98ce9
1 changed files with 6 additions and 6 deletions

View File

@ -1,8 +1,8 @@
<template> <template>
<a-dropdown v-if="currentUser && currentUser.userName" placement="bottomRight"> <a-dropdown v-if="currentUser && currentUser.name" placement="bottomRight">
<span class="ant-pro-account-avatar"> <span class="ant-pro-account-avatar">
<a-avatar size="small" src="https://gw.alipayobjects.com/zos/antfincdn/XAosXuNZyF/BiazfanxmamNRoxxVxka.png" class="antd-pro-global-header-index-avatar" /> <a-avatar size="small" src="https://gw.alipayobjects.com/zos/antfincdn/XAosXuNZyF/BiazfanxmamNRoxxVxka.png" class="antd-pro-global-header-index-avatar" />
<span>{{ currentUser.userName }}</span> <span>{{ currentUser.name }}</span>
</span> </span>
<template v-slot:overlay> <template v-slot:overlay>
<a-menu class="ant-pro-drop-down menu" :selected-keys="[]"> <a-menu class="ant-pro-drop-down menu" :selected-keys="[]">
@ -43,13 +43,13 @@ export default {
} }
}, },
methods: { methods: {
handleToCenter () { handleToCenter() {
this.$router.push({ path: '/account/center' }) this.$router.push({ path: '/account/center' })
}, },
handleToSettings () { handleToSettings() {
this.$router.push({ path: '/account/settings' }) this.$router.push({ path: '/account/settings' })
}, },
handleLogout (e) { handleLogout(e) {
Modal.confirm({ Modal.confirm({
title: this.$t('layouts.usermenu.dialog.title'), title: this.$t('layouts.usermenu.dialog.title'),
content: this.$t('layouts.usermenu.dialog.content'), content: this.$t('layouts.usermenu.dialog.content'),
@ -61,7 +61,7 @@ export default {
this.$router.push({ name: 'login' }) this.$router.push({ name: 'login' })
}) })
}, },
onCancel () {} onCancel() { }
}) })
} }
} }