mirror of
https://github.com/Tencent/tdesign-vue-next-starter.git
synced 2024-12-22 18:20:59 +08:00
优化展示用户名,而不是固定为Tencent (#485)
* Update user.ts * Update Header.vue * Update user.ts * Update user.ts
This commit is contained in:
parent
0d70db425d
commit
2794bdcb5c
|
@ -48,7 +48,7 @@
|
|||
<template #icon>
|
||||
<t-icon class="header-user-avatar" name="user-circle" />
|
||||
</template>
|
||||
<div class="header-user-account">Tencent</div>
|
||||
<div class="header-user-account">{{ user.userInfo.name }}</div>
|
||||
<template #suffix><t-icon name="chevron-down" /></template>
|
||||
</t-button>
|
||||
</t-dropdown>
|
||||
|
@ -71,7 +71,7 @@ import { useRouter } from 'vue-router';
|
|||
import LogoFull from '@/assets/assets-logo-full.svg?component';
|
||||
import { prefix } from '@/config/global';
|
||||
import { getActive } from '@/router';
|
||||
import { useSettingStore } from '@/store';
|
||||
import { useSettingStore, useUserStore } from '@/store';
|
||||
import type { MenuRoute } from '@/types/interface';
|
||||
|
||||
import MenuContent from './MenuContent.vue';
|
||||
|
@ -111,6 +111,7 @@ const props = defineProps({
|
|||
|
||||
const router = useRouter();
|
||||
const settingStore = useSettingStore();
|
||||
const user = useUserStore();
|
||||
|
||||
const toggleSettingPanel = () => {
|
||||
settingStore.updateConfig({
|
||||
|
|
|
@ -4,6 +4,7 @@ import { TOKEN_NAME } from '@/config/global';
|
|||
import { store, usePermissionStore } from '@/store';
|
||||
|
||||
const InitUserInfo = {
|
||||
name: '', // 用户名,用于展示在页面右上角头像处
|
||||
roles: [], // 前端权限模型使用 如果使用请配置modules/permission-fe.ts使用
|
||||
};
|
||||
|
||||
|
@ -57,7 +58,7 @@ export const useUserStore = defineStore('user', {
|
|||
const mockRemoteUserInfo = async (token: string) => {
|
||||
if (token === 'main_token') {
|
||||
return {
|
||||
name: 'td_main',
|
||||
name: 'Tencent',
|
||||
roles: ['all'], // 前端权限模型使用 如果使用请配置modules/permission-fe.ts使用
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user