import { getProxyUrl as getProxy } from './hostapp'; export function getProxyUrl(): string { const result = getProxy(); // code 非 200 或 data 为非 http 地址时,返回空字符串,避免污染 baseURL if (result.code?.toString() !== '200') return ''; const url = result.data || ''; return url.startsWith('http') ? url : ''; };