fix desktop operator name fallback
This commit is contained in:
@@ -64,8 +64,24 @@ const navItems = computed(() => {
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
const operatorName = computed(() => session.value?.user?.name ?? '未命名操作员')
|
const operatorName = computed(() => {
|
||||||
const operatorEmail = computed(() => session.value?.user?.email ?? '')
|
const user = session.value?.user
|
||||||
|
return (
|
||||||
|
user?.name?.trim() ||
|
||||||
|
user?.phone?.trim() ||
|
||||||
|
user?.email?.trim() ||
|
||||||
|
'未命名操作员'
|
||||||
|
)
|
||||||
|
})
|
||||||
|
const operatorEmail = computed(() => {
|
||||||
|
const user = session.value?.user
|
||||||
|
const email = user?.email?.trim()
|
||||||
|
const phone = user?.phone?.trim()
|
||||||
|
if (email && phone && email !== operatorName.value) {
|
||||||
|
return email
|
||||||
|
}
|
||||||
|
return phone && phone !== operatorName.value ? phone : ''
|
||||||
|
})
|
||||||
const liveClientLabel = computed(() => snapshot.value?.clients[0]?.deviceName ?? null)
|
const liveClientLabel = computed(() => snapshot.value?.clients[0]?.deviceName ?? null)
|
||||||
const clientLabel = computed(
|
const clientLabel = computed(
|
||||||
() =>
|
() =>
|
||||||
|
|||||||
Reference in New Issue
Block a user