// 应用配置 API const GRAPHQL_ENDPOINT = 'http://localhost:8080/api/graphql'; const GET_APP_CONFIG = ` query AppConfig { appConfig { mediaBaseUrl } } `; export const fetchAppConfig = async () => { const resp = await fetch(GRAPHQL_ENDPOINT, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ query: GET_APP_CONFIG }) }); const result = await resp.json(); if (result.errors) throw new Error(result.errors[0].message); return result.data.appConfig; };