feat(platform): 按平台能力控制功能入口与请求

This commit is contained in:
mofeng-git
2026-10-17 22:12:22 +08:00
parent 3a881ed0f7
commit b657ef76bc
9 changed files with 83 additions and 34 deletions

View File

@@ -86,7 +86,8 @@ const unifiedAudio = getUnifiedAudio()
const microphone = getMicrophone()
const uacEnabled = ref(false)
const microphoneTransferEnabled = computed(() => (
uacEnabled.value && configStore.hid?.backend === HidBackend.Otg
systemStore.platform?.otg.available === true
&& uacEnabled.value && configStore.hid?.backend === HidBackend.Otg
))
const videoSession = useVideoSession()
@@ -3124,6 +3125,11 @@ function handleToggleMouseMode() {
async function refreshUacAvailability() {
try {
if (!systemStore.platform) await systemStore.fetchSystemInfo()
if (!systemStore.platform?.otg.available) {
uacEnabled.value = false
return
}
const uacConfig = await uacApi.get()
uacEnabled.value = uacConfig.enabled
} catch {