Commit ae900c2d by zhangxingmin

配置 test

parent 1666420d
...@@ -12,14 +12,21 @@ let downloadLoadingInstance ...@@ -12,14 +12,21 @@ let downloadLoadingInstance
export let isRelogin = { show: false } export let isRelogin = { show: false }
axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8' axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
// 创建axios实例
// 使用相对路径 /api,而不是完整URL
const service = axios.create({ const service = axios.create({
// axios中请求配置有baseURL选项,表示请求URL公共部分 baseURL: '/api', // 使用相对路径
baseURL: import.meta.env.VITE_APP_BASE_API, timeout: 10000
// 超时
timeout: 10000
}) })
// 创建axios实例
// const service = axios.create({
// // axios中请求配置有baseURL选项,表示请求URL公共部分
// baseURL: import.meta.env.VITE_APP_BASE_API,
// // 超时
// timeout: 10000
// })
// request拦截器 // request拦截器
service.interceptors.request.use( service.interceptors.request.use(
config => { config => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment