初步完成merchant和admin不同role的展示内容逻辑2
This commit is contained in:
@@ -62,10 +62,18 @@ import {
|
||||
openRoute
|
||||
} from '@/layouts/admin/store/adminNavStore.uts'
|
||||
import { state, logout } from '@/utils/store.uts'
|
||||
import { clearAdminRoleCache } from '@/layouts/admin/utils/role.uts'
|
||||
import { clearAdminRoleCache, getCurrentAdminRole } from '@/layouts/admin/utils/role.uts'
|
||||
|
||||
const showUserMenu = ref(false)
|
||||
const userName = computed((): string => state.userProfile.username || state.userProfile.email || 'admin')
|
||||
const userName = computed((): string => {
|
||||
if (state.userProfile?.username != null && state.userProfile!.username != '') return state.userProfile!.username as string
|
||||
if (state.authUser != null) {
|
||||
if (state.authUser!.getString('email') != null && state.authUser!.getString('email') != '') return state.authUser!.getString('email') as string
|
||||
if (state.authUser!.getString('phone') != null && state.authUser!.getString('phone') != '') return state.authUser!.getString('phone') as string
|
||||
if (state.authUser!.getString('id') != null && state.authUser!.getString('id') != '') return (state.authUser!.getString('id') as string).substring(0, 8)
|
||||
}
|
||||
return '未知用户'
|
||||
})
|
||||
|
||||
let hideMenuTimer: number | null = null
|
||||
|
||||
|
||||
Reference in New Issue
Block a user