App.vue 1.8 KB

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