fix desktop operator name fallback

This commit is contained in:
2026-05-24 10:23:50 +08:00
parent a078dab687
commit 09c8fe1e56
@@ -64,8 +64,24 @@ const navItems = computed(() => {
]
})
const operatorName = computed(() => session.value?.user?.name ?? '未命名操作员')
const operatorEmail = computed(() => session.value?.user?.email ?? '')
const operatorName = computed(() => {
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 clientLabel = computed(
() =>