展品维保小程序前端代码接口
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.

76 lines
1.9 KiB

2 weeks ago
  1. // 环境配置相关
  2. /**
  3. * 环境配置
  4. * env 环境变量字段
  5. * netConfig 网络配置
  6. * aliOSSConfig 阿里云配置
  7. * debounceConfig 防抖相关配置
  8. */
  9. const env = 'development'
  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://www.mulinyouni.com/community-admin/community',
  22. }
  23. },
  24. // 阿里云配置
  25. aliOSSConfig :{
  26. development: {
  27. aliOSS_accessKey: 'LTAI5tQSs47izVy8DLVdwUU9',
  28. aliOSS_secretKey: 'qHI7C3PaXYZySr84HTToviC71AYlFq',
  29. aliOSS_bucketName: 'hanhaiimage',
  30. endpoint: 'oss-cn-shenzhen.aliyuncs.com',
  31. staticDomain: 'https://image.hhlm1688.com/'
  32. },
  33. testing: {
  34. aliOSS_accessKey: 'LTAI5tQSs47izVy8DLVdwUU9',
  35. aliOSS_secretKey: 'qHI7C3PaXYZySr84HTToviC71AYlFq',
  36. aliOSS_bucketName: 'hanhaiimage',
  37. endpoint: 'oss-cn-shenzhen.aliyuncs.com',
  38. staticDomain: 'https://image.hhlm1688.com/'
  39. },
  40. production: {
  41. aliOSS_accessKey: 'LTAI5tRqoxbC9BKrWJduKDVT',
  42. aliOSS_secretKey: 's5ANiOq4kYpzuMLQhqPMYL4IybMR7L',
  43. aliOSS_bucketName: 'mulinyouni',
  44. endpoint: 'oss-cn-beijing.aliyuncs.com',
  45. staticDomain: 'https://image.mulinyouni.com/'
  46. },
  47. },
  48. // 防抖相关配置
  49. debounceConfig : {
  50. DEFAULT_DEBOUNCE_TIME: 0,
  51. DEFAULT_THROTTLE_TIME: 0,
  52. MAX_MAP_SIZE: 1000,
  53. }
  54. }
  55. // 全自动导入并生成平坦化结构
  56. const finalConfig = Object.keys(config).reduce((finallyConfig, key) => {
  57. let tempConfig = {}
  58. if (key === 'netConfig' || key === 'aliOSSConfig') {
  59. tempConfig = config[key][env]
  60. }else {
  61. tempConfig = config[key]
  62. }
  63. return {
  64. ...finallyConfig,
  65. ...tempConfig,
  66. }
  67. }, {})
  68. export default finalConfig