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.

18 lines
415 B

1 year ago
1 year ago
  1. import axios, { AxiosRequestConfig } from 'axios'
  2. export type { AxiosRequestConfig }
  3. export const request = axios.create({
  4. baseURL: '/api/v1',
  5. timeout: 1000,
  6. headers: {
  7. 'Content-Type': 'application/json',
  8. },
  9. })
  10. //拦截response,返回data
  11. request.interceptors.response.use((response) => {
  12. // console.log('response', response.data)
  13. return response.data
  14. })
  15. export default request