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

79 lines
1.9 KiB

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