App.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <div class="body-content">
  3. <home-slice v-if="showSlice && slice_type === 1"/>
  4. <home-slice-online v-if="showSlice && slice_type === 0"/>
  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. slice_type
  32. }
  33. },
  34. methods: {
  35. setUserInfo () {
  36. // storageGet('user').then((res)=>{
  37. // if (res == null){
  38. // this.setCurrUserByHttp()
  39. // }else{
  40. // this.fullScreenLoading = false
  41. // this.isLogin = true
  42. // }
  43. // }).catch((error)=>{
  44. // this.setCurrUserByHttp()
  45. // })
  46. // if (storageGet('user') == null) {
  47. // storageSave('rolesPermissions', {
  48. // 'isRegionManager': false,
  49. // 'isIndividualUser': false,
  50. // 'isEnterpriseUser': false,
  51. // 'isAgency': false,
  52. // 'isSystemAdministrator': false
  53. // })
  54. // console.log('本地没有用户信息,开始加载用户信息')
  55. // getCurrentUser().then((res) => {
  56. // console.log(res)
  57. // storageSave('user', res)
  58. // storageSave('rolesPermissions', getRolesPermissions(res.roleList))
  59. // console.log('用户信息加载成功')
  60. // }).catch(error => {
  61. // console.log('用户信息加载失败')
  62. // if (error.status == 401) {
  63. // notify('warning', error.data)
  64. // } else {
  65. // notify('error', error.data)
  66. // }
  67. // })
  68. // } else {
  69. // this.fullScreenLoading = false
  70. // this.isLogin = true
  71. // }
  72. },
  73. },
  74. computed:{
  75. showSlice(){
  76. if(this.$route.path==='/home' || this.$route.path==='/')
  77. return true;
  78. }
  79. },
  80. }
  81. </script>
  82. <style>
  83. .body-content{
  84. width:100%;
  85. min-width: 1300px;
  86. height: 100%;
  87. }
  88. .container-wrapper {
  89. min-height: calc(100% - 70px - 180px);
  90. }
  91. .main-container {
  92. width: 100%;
  93. min-height: calc(100% - 70px - 180px);
  94. margin: 0 auto;
  95. padding-bottom: 30px;
  96. }
  97. .home-slice {
  98. width: 100%;
  99. height: 170px;
  100. background-image: url("./assets/img/homeSlice.png");
  101. background-size: 100% 100%
  102. }
  103. </style>