1
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import axios, { type InternalAxiosRequestConfig } from 'axios'
|
||||
import { parseApiJsonResponse } from '@chongchong/shared'
|
||||
|
||||
export interface ApiEnvelope<T> {
|
||||
code: string
|
||||
@@ -37,6 +38,7 @@ export interface ApiErrorDetails {
|
||||
export const http = axios.create({
|
||||
baseURL: import.meta.env.VITE_API_BASE_URL || '/api',
|
||||
timeout: 15_000,
|
||||
transformResponse: [(data: unknown) => parseApiJsonResponse(data)],
|
||||
})
|
||||
|
||||
type RetryableRequestConfig = InternalAxiosRequestConfig & { _authRetry?: boolean }
|
||||
|
||||
Reference in New Issue
Block a user