App.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <div class="body-content">
  3. <home-slice v-if="showSlice && this.$env === 'private'"/>
  4. <home-slice-online v-else/>
  5. <header-container/>
  6. <div class="container-wrapper">
  7. <slot>
  8. <div class="main-container">
  9. <router-view/>
  10. </div>
  11. </slot>
  12. </div>
  13. <footer-container/>
  14. </div>
  15. </template>
  16. <script>
  17. import Http from '@/js/http.js'
  18. import HeaderContainer from '@/components/commons/Header2.0'
  19. import FooterContainer from '@/components/commons/Footer2.0'
  20. import HomeSlice from '@/components/commons/HomeSlice'
  21. import HomeSliceOnline from '@/components/commons/HomeSliceOnline'
  22. import {getCurrentUser, storageGet, storageSave} from '@/js/index'
  23. import {setConfig} from '../src/config/index'
  24. import {slice_type} from "../tool4deploy/slider-type";
  25. export default {
  26. name: 'App',
  27. components: {HeaderContainer, FooterContainer, HomeSlice ,HomeSliceOnline},
  28. data(){
  29. return {
  30. // showSlice:false
  31. }
  32. },
  33. methods: {
  34. setUserInfo () {
  35. // storageGet('user').then((res)=>{
  36. // if (res == null){
  37. // this.setCurrUserByHttp()
  38. // }else{
  39. // this.fullScreenLoading = false
  40. // this.isLogin = true
  41. // }
  42. // }).catch((error)=>{
  43. // this.setCurrUserByHttp()
  44. // })
  45. // if (storageGet('user') == null) {
  46. // storageSave('rolesPermissions', {
  47. // 'isRegionManager': false,
  48. // 'isIndividualUser': false,
  49. // 'isEnterpriseUser': false,
  50. // 'isAgency': false,
  51. // 'isSystemAdministrator': false
  52. // })
  53. // console.log('本地没有用户信息,开始加载用户信息')
  54. // getCurrentUser().then((res) => {
  55. // console.log(res)
  56. // storageSave('user', res)
  57. // storageSave('rolesPermissions', getRolesPermissions(res.roleList))
  58. // console.log('用户信息加载成功')
  59. // }).catch(error => {
  60. // console.log('用户信息加载失败')
  61. // if (error.status == 401) {
  62. // notify('warning', error.data)
  63. // } else {
  64. // notify('error', error.data)
  65. // }
  66. // })
  67. // } else {
  68. // this.fullScreenLoading = false
  69. // this.isLogin = true
  70. // }
  71. },
  72. },
  73. computed:{
  74. showSlice(){
  75. if(this.$route.path==='/home' || this.$route.path==='/')
  76. return true;
  77. }
  78. },
  79. }
  80. </script>
  81. <style lang="scss">
  82. .body-content{
  83. width:100%;
  84. min-width: 1300px;
  85. height: 100%;
  86. }
  87. .container-wrapper {
  88. min-height: calc(100% - 70px - 180px);
  89. }
  90. .main-container {
  91. width: 100%;
  92. min-height: calc(100% - 70px - 180px);
  93. margin: 0 auto;
  94. padding-bottom: 30px;
  95. }
  96. .home-slice {
  97. width: 100%;
  98. height: 170px;
  99. background-image: url("./assets/img/homeSlice.png");
  100. background-size: 100% 100%
  101. }
  102. </style>