diff --git a/frontend/src/lib/api-services.ts b/frontend/src/lib/api-services.ts index a6dee1c..7a8d6b1 100644 --- a/frontend/src/lib/api-services.ts +++ b/frontend/src/lib/api-services.ts @@ -1005,6 +1005,11 @@ portalAxios.interceptors.request.use((config: any) => { if (token) config.headers.Authorization = `Bearer ${token}` return config }) +// 与管理端 api 实例一致:response interceptor 返回 response.data(后端 JSON body) +portalAxios.interceptors.response.use( + (response) => response.data, + (error) => Promise.reject(error), +) const portalGet = ((url: string, config?: any) => portalAxios.get(url, config)) as any const portalPost = ((url: string, data?: any, config?: any) => portalAxios.post(url, data, config)) as any