You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
415 B
19 lines
415 B
import axios, { AxiosRequestConfig } from 'axios'
|
|
|
|
export type { AxiosRequestConfig }
|
|
|
|
export const request = axios.create({
|
|
baseURL: '/api/v1',
|
|
timeout: 1000,
|
|
headers: {
|
|
'Content-Type': 'application/json',
|
|
},
|
|
})
|
|
|
|
//拦截response,返回data
|
|
request.interceptors.response.use((response) => {
|
|
// console.log('response', response.data)
|
|
return response.data
|
|
})
|
|
|
|
export default request
|