refactor(utils): 统一使用VUE_APP_BASE_API环境变量
将请求配置中的VUE_APP_SERVICE_BASE_API替换为VUE_APP_BASE_API,保持环境变量命名一致性
This commit is contained in:
@@ -17,7 +17,7 @@ axios.defaults.headers['Content-Language'] = 'zh_CN'
|
||||
// 创建axios实例
|
||||
const service = axios.create({
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
baseURL: process.env.VUE_APP_SERVICE_BASE_API,
|
||||
baseURL: process.env.VUE_APP_BASE_API,
|
||||
// 超时
|
||||
timeout: 10000,
|
||||
// 自定义响应数据转换,处理大整数ID精度问题
|
||||
@@ -28,7 +28,7 @@ const service = axios.create({
|
||||
}]
|
||||
})
|
||||
|
||||
console.log(process.env.VUE_APP_SERVICE_BASE_API, service, process.env)
|
||||
console.log(process.env.VUE_APP_BASE_API, service, process.env)
|
||||
|
||||
// request拦截器
|
||||
service.interceptors.request.use(config => {
|
||||
|
||||
@@ -17,7 +17,7 @@ axios.defaults.headers['Content-Language'] = 'zh_CN'
|
||||
// 创建axios实例
|
||||
const service = axios.create({
|
||||
// axios中请求配置有baseURL选项,表示请求URL公共部分
|
||||
baseURL: process.env.VUE_APP_SERVICE_BASE_API,
|
||||
baseURL: process.env.VUE_APP_BASE_API,
|
||||
// 超时
|
||||
timeout: 10000,
|
||||
// 自定义响应数据转换,处理大整数ID精度问题
|
||||
@@ -28,7 +28,7 @@ const service = axios.create({
|
||||
}]
|
||||
})
|
||||
|
||||
console.log(process.env.VUE_APP_SERVICE_BASE_API, service, process.env)
|
||||
console.log(process.env.VUE_APP_BASE_API, service, process.env)
|
||||
|
||||
// request拦截器
|
||||
service.interceptors.request.use(config => {
|
||||
|
||||
Reference in New Issue
Block a user