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

@@ -260,6 +260,11 @@ export const useSystemStore = defineStore('system', () => {
async function fetchMsdState() {
try {
if (!platform.value) await fetchSystemInfo()
if (!platform.value?.msd.available) {
msd.value = null
return null
}
const result = await msdApi.status()
msd.value = {
available: result.available,
@@ -306,12 +311,13 @@ export const useSystemStore = defineStore('system', () => {
error.value = null
try {
const systemInfoRequest = fetchSystemInfo()
await Promise.all([
fetchSystemInfo(),
systemInfoRequest,
fetchStreamState().catch(() => null),
fetchHidState().catch(() => null),
fetchAtxState().catch(() => null),
fetchMsdState().catch(() => null),
systemInfoRequest.then(() => fetchMsdState()).catch(() => null),
])
} catch (e) {
error.value = e instanceof Error ? e.message : 'Failed to fetch states'