import axios from 'axios'; const instance = axios.create({ baseURL: '/api', timeout: 20000 }); instance.interceptors.response.use( (res) => { const body = res.data; if (body && typeof body === 'object' && 'code' in body) { return body.code === 0 ? body.data : Promise.reject(body); } return body; }, (err) => Promise.reject(err), ); export function fetchTrace(shortCode: string): Promise { return instance.get(`/public/trace/${shortCode}`) as unknown as Promise; } export function fetchAppInfo(): Promise { return instance.get('/settings/public') as unknown as Promise; }