You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
835 B
TypeScript

import { AxiosConfig, AxiosResponse } from './type'
const config: AxiosConfig = {
/**
* api
*/
baseUrl: {
// 开发环境接口前缀
base: '',
// 打包开发环境接口前缀
dev: '',
// 打包生产环境接口前缀
pro: '',
// 打包测试环境接口前缀
test: ''
},
/**
*
*/
code: '0000',
/**
*
*/
timeout: 60000,
/**
*
* application/x-www-form-urlencoded multipart/form-data
*/
defaultHeaders: 'application/json',
interceptors: {
requestInterceptors: (config) => {
return config
},
// 响应拦截器
responseInterceptors: (result: AxiosResponse) => {
return result
}
}
}
export default config