config.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //生产
  2. const PRO_BASE_URL = "https://pro.cloud.boyuantech.net/manage/api/v1/miniScmApp"
  3. const PRO_IMG_BASE_URL = "https://pro.cloud.boyuantech.net/img"
  4. const PRO_ROOM_TYPE_PIC_URL = "https://pro.cloud.boyuantech.net/img"
  5. //测试
  6. const TEST_BASE_URL = "https://test.cloud.boyuantech.net/mp/api/v1"
  7. const TEST_IMG_BASE_URL = "https://test.cloud.boyuantech.net/img"
  8. const TEST_ROOM_TYPE_PIC_URL = "https://test.cloud.boyuantech.net/hotel-room-type-img/"
  9. //本地
  10. const DEV_BASE_URL = "http://localhost:9041/api/v1"
  11. const DEV_IMG_BASE_URL = "https://pro.cloud.boyuantech.net/img"
  12. const DEV_ROOM_TYPE_PIC_URL = "https://pro.cloud.boyuantech.net/img"
  13. let BASE_URL
  14. let IMG_BASE_URL
  15. let ROOM_TYPE_PIC_URL
  16. const accountInfo = uni.getAccountInfoSync();
  17. const env = accountInfo.miniProgram.envVersion
  18. if (env === 'release') {
  19. BASE_URL = PRO_BASE_URL
  20. IMG_BASE_URL = PRO_IMG_BASE_URL
  21. } else {
  22. // 生产环境
  23. // BASE_URL = PRO_BASE_URL
  24. // IMG_BASE_URL = PRO_IMG_BASE_URL
  25. // ROOM_TYPE_PIC_URL = PRO_ROOM_TYPE_PIC_URL
  26. // 测试环境
  27. BASE_URL = TEST_BASE_URL
  28. IMG_BASE_URL = TEST_IMG_BASE_URL
  29. ROOM_TYPE_PIC_URL =TEST_ROOM_TYPE_PIC_URL
  30. // 开发环境
  31. // BASE_URL = DEV_BASE_URL
  32. // IMG_BASE_URL = DEV_IMG_BASE_URL
  33. // ROOM_TYPE_PIC_URL= DEV_ROOM_TYPE_PIC_URL
  34. }
  35. export {
  36. BASE_URL,
  37. IMG_BASE_URL,
  38. ROOM_TYPE_PIC_URL
  39. }