App.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <script>
  2. const uat_URL = 'https://lese.test.sxzxyj.net/gc-channel/' // 预发布
  3. // const uat_URL = 'http://192.168.16.104:8303/gc-channel/' // 本地
  4. const pro_URL = 'https://lese.sxzxyj.net/gc-channel/' // 生产
  5. const buildType = 1 // 打包环境对应类型,1 生产 0 预发布
  6. const buildURL = buildType ? pro_URL : uat_URL // 打包后实际对应的url
  7. const envText = ['预发布环境','生产环境']
  8. const envTips = process.env.NODE_ENV == 'development' ? envText[0] : envText[buildType]
  9. console.log(process.env.NODE_ENV)
  10. export default {
  11. globalData: {
  12. baseUrl: process.env.NODE_ENV == 'development' ? uat_URL : buildURL,
  13. token: '',
  14. version: '', // 当前版本号
  15. buildType: buildType,
  16. envTips: envTips
  17. },
  18. mounted() {
  19. // 非V3模式
  20. if(this.$scope){
  21. this.$scope.globalData.token = this.$store.state.vuex_token
  22. }else{
  23. // V3模式
  24. getApp({allowDefault: true}).globalData.token = this.$store.state.vuex_token
  25. }
  26. },
  27. onLaunch: function() {
  28. console.log('App onLaunch')
  29. },
  30. onShow: function() {
  31. console.log('App Show')
  32. },
  33. onHide: function() {
  34. console.log('App Hide')
  35. },
  36. }
  37. </script>
  38. <style lang="scss">
  39. @import "uview-ui/index.scss";
  40. /*每个页面公共css */
  41. page {
  42. min-height: 100%;
  43. display: flex;
  44. background-color: #F8F8F8;
  45. }
  46. /* 登录页是否记住密码多选框样式 */
  47. uni-checkbox.login-form-checkbox .uni-checkbox-input{
  48. width: 24upx !important;
  49. height: 24upx !important;
  50. }
  51. </style>