refactor: 重命名客户端工程

This commit is contained in:
Nixevol
2026-07-03 03:08:05 +08:00
parent b9e2b78fcd
commit 70a8528f41
35 changed files with 64 additions and 61 deletions
+22
View File
@@ -0,0 +1,22 @@
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<any> {
return instance.get(`/public/trace/${shortCode}`) as unknown as Promise<any>;
}
export function fetchAppInfo(): Promise<any> {
return instance.get('/settings/public') as unknown as Promise<any>;
}