木邻有你前端代码仓库
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.

58 lines
1.3 KiB

1 month ago
1 month ago
  1. // 环境配置相关
  2. /**
  3. * 环境配置
  4. * env 环境变量字段
  5. * netConfig 网络配置
  6. * aliOSSConfig 阿里云配置
  7. * debounceConfig 防抖相关配置
  8. */
  9. const env = 'testing'
  10. // 全局配置
  11. const config = {
  12. // 网络全局配置
  13. netConfig: {
  14. development: {
  15. baseURL: 'http://augcl.natapp1.cc/community-admin/community',
  16. },
  17. testing: {
  18. baseURL: 'https://mulinyouni.augcl.com/community-admin/community',
  19. },
  20. production: {
  21. baseURL: 'https://api.escuelajs.co/api/v1',
  22. }
  23. },
  24. // 阿里云配置
  25. aliOSSConfig :{
  26. aliOSS_accessKey: 'LTAI5tQSs47izVy8DLVdwUU9',
  27. aliOSS_secretKey: 'qHI7C3PaXYZySr84HTToviC71AYlFq',
  28. aliOSS_bucketName: 'hanhaiimage',
  29. endpoint: 'oss-cn-shenzhen.aliyuncs.com',
  30. staticDomain: 'https://image.hhlm1688.com/'
  31. },
  32. // 防抖相关配置
  33. debounceConfig : {
  34. DEFAULT_DEBOUNCE_TIME: 0,
  35. DEFAULT_THROTTLE_TIME: 0,
  36. MAX_MAP_SIZE: 1000,
  37. }
  38. }
  39. // 全自动导入并生成平坦化结构
  40. const finalConfig = Object.keys(config).reduce((finallyConfig, key) => {
  41. let tempConfig = {}
  42. if (key === 'netConfig') {
  43. tempConfig = config[key][env]
  44. }else {
  45. tempConfig = config[key]
  46. }
  47. return {
  48. ...finallyConfig,
  49. ...tempConfig,
  50. }
  51. }, {})
  52. export default finalConfig