index.ts 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import axios from 'axios';
  2. // 基础配置
  3. export const API_BASE_URL = '/api';
  4. // 全局axios配置
  5. axios.defaults.baseURL = API_BASE_URL;
  6. // 获取OSS完整URL
  7. export const getOssUrl = (path: string): string => {
  8. // 获取全局配置中的OSS_HOST,如果不存在使用默认值
  9. const ossHost = (window.CONFIG?.OSS_BASE_URL) || '';
  10. // 确保path不以/开头
  11. const ossPath = path.startsWith('/') ? path.substring(1) : path;
  12. return `${ossHost}/${ossPath}`;
  13. };
  14. export * from './auth.ts';
  15. export * from './users.ts';
  16. export * from './files.ts';
  17. export * from './theme.ts';
  18. export * from './charts.ts';
  19. export * from './messages.ts';
  20. export * from './sys.ts';
  21. export * from './know_info.ts';
  22. export * from './maps.ts';
  23. export * from './zichan.ts'
  24. export * from './zichan_category.ts'
  25. export * from './zichan_area.ts'
  26. export * from './zichan_transfer.ts'
  27. export * from './device_instance.ts'
  28. export * from './device_type.ts'
  29. export * from './rack.ts'
  30. export * from './rack_server.ts'
  31. export * from './rack_server_type.ts'
  32. export * from './monitor.ts'
  33. export * from './alert.ts'
  34. export * from './alert_handle.ts'
  35. export * from './alert_notify_config.ts'
  36. export * from './device_alert_rule.ts'
  37. export * from './monitor_charts.ts'
  38. export * from './work_orders.ts'