chore: 修改配置

This commit is contained in:
kailong321200875
2023-10-27 13:54:01 +08:00
parent 2e7797be68
commit 7c1dee1bf6
8 changed files with 8 additions and 31 deletions

View File

@@ -8,23 +8,6 @@ import { ElMessage } from 'element-plus'
import qs from 'qs'
const config: AxiosConfig = {
/**
* api请求基础路径
*/
baseUrl: {
// 开发环境接口前缀
base: '',
// 打包开发环境接口前缀
dev: '',
// 打包生产环境接口前缀
pro: '',
// 打包测试环境接口前缀
test: ''
},
/**
* 接口成功返回状态码
*/

View File

@@ -4,8 +4,8 @@ import config, { defaultRequestInterceptors, defaultResponseInterceptors } from
import { AxiosInstance, InternalAxiosRequestConfig, RequestConfig, AxiosResponse } from './types'
import { ElMessage } from 'element-plus'
const { interceptors, baseUrl } = config
export const PATH_URL = baseUrl[import.meta.env.VITE_API_BASE_PATH]
const { interceptors } = config
export const PATH_URL = import.meta.env.VITE_API_BASE_PATH
const { requestInterceptors, responseInterceptors } = interceptors

View File

@@ -16,12 +16,6 @@ interface RequestInterceptors<T> {
responseInterceptorsCatch?: (err: any) => any
}
interface AxiosConfig<T = AxiosResponse> {
baseUrl: {
base: string
dev: string
pro: string
test: string
}
code: number
defaultHeaders: AxiosHeaders
timeout: number