init
This commit is contained in:
33
src/config/axios/config.ts
Normal file
33
src/config/axios/config.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
const config: {
|
||||
base_url: string
|
||||
result_code: number | string
|
||||
default_headers: AxiosHeaders
|
||||
request_timeout: number
|
||||
} = {
|
||||
/**
|
||||
* api请求基础路径
|
||||
*/
|
||||
base_url: import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL,
|
||||
/**
|
||||
* 接口成功返回状态码
|
||||
*/
|
||||
result_code: 200,
|
||||
|
||||
/**
|
||||
* 接口请求超时时间
|
||||
*/
|
||||
request_timeout: 30000,
|
||||
|
||||
/**
|
||||
* 默认接口请求类型
|
||||
* 可选值:application/x-www-form-urlencoded multipart/form-data
|
||||
*/
|
||||
default_headers: 'application/json'
|
||||
}
|
||||
|
||||
//对特定接口延迟超时时间
|
||||
const specificApiTimeoutObj = {
|
||||
'/infra/file/jeelowcode/upload': 120000,//上传文件接口
|
||||
}
|
||||
|
||||
export { config, specificApiTimeoutObj }
|
||||
Reference in New Issue
Block a user