App.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <script>
  2. export default {
  3. onLaunch: function() {
  4. let BASE_URL = "";
  5. var env ='';
  6. // let res = uni.getStorageSync('env')
  7. let res = '1'
  8. switch(res){
  9. case '1': //dev
  10. BASE_URL = 'http://192.168.4.212:8866' // 开发环境
  11. env = 'dev'
  12. break;
  13. case '2': //test
  14. BASE_URL = 'http://192.168.4.212:8866'
  15. env = 'test'
  16. break;
  17. case '3'://test2
  18. BASE_URL = 'http://gatewaytest1.elab-plus.com'
  19. env = 'test2'
  20. break;
  21. case '4'://test3
  22. BASE_URL = 'https://gatewaytest3.skyforestcity.com'
  23. env = 'test3'
  24. break;
  25. case '5'://test4
  26. BASE_URL = 'https://gatewaytest4.skyforestcity.com'
  27. env = 'test4'
  28. break;
  29. case '6'://uat3
  30. BASE_URL = "https://api-uat3.elaber.cn"
  31. env = 'uat3'
  32. break;
  33. case '7': //uat
  34. BASE_URL = "https://api-uat.elaber.cn"
  35. env = 'uat'
  36. break;
  37. case '8': // 线上 product
  38. default:
  39. BASE_URL = "https://dm-api.elab-plus.cn"
  40. env = 'production'
  41. break;
  42. }
  43. this.globalData.BASE_URL = BASE_URL;
  44. this.globalData.env = env;
  45. let plat = uni.getSystemInfoSync().platform;
  46. this.globalData.platform = plat
  47. let userInfo = uni.getStorageSync('userInfo');//获得保存在本地的用户信息
  48. },
  49. onShow: function() {
  50. document.body.style.setProperty("background-color",this.globalData.color4)
  51. },
  52. onHide: function() {
  53. },
  54. methods: {
  55. getThemeInfo() {
  56. }
  57. },
  58. globalData: {
  59. token: "",
  60. color1: "#F07423",
  61. color2: "#FD8F3C",
  62. color3: "#FFC444",
  63. color4: "#F5F5F7",
  64. color5: "#F7A98E",
  65. color6: "#FFF4EB",
  66. color7:"#F8BA91",
  67. color8:"#FFF4EB",
  68. color9:"#8B654D",
  69. color10:"#FCF6F1",
  70. BASE_URL:"https://dm-api.elab-plus.cn",//默认环境
  71. }
  72. }
  73. </script>
  74. <style>
  75. </style>