config.ts 550 B

12345678910111213141516171819202122232425262728
  1. const config: {
  2. base_url: string
  3. result_code: number | string
  4. default_headers: AxiosHeaders
  5. request_timeout: number
  6. } = {
  7. /**
  8. * api请求基础路径
  9. */
  10. base_url: import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL,
  11. /**
  12. * 接口成功返回状态码
  13. */
  14. result_code: 200,
  15. /**
  16. * 接口请求超时时间
  17. */
  18. request_timeout: 30000,
  19. /**
  20. * 默认接口请求类型
  21. * 可选值:application/x-www-form-urlencoded multipart/form-data
  22. */
  23. default_headers: 'application/json'
  24. }
  25. export { config }