App.vue 2.4 KB

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