App.vue 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <div class="body-content">
  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 Http from '@/js/http.js'
  17. import HeaderContainer from '@/components/commons/Header2.0'
  18. import FooterContainer from '@/components/commons/Footer2.0'
  19. import HomeSlice from '@/components/commons/HomeSlice'
  20. import {getCurrentUser, storageGet, storageSave} from '@/js/index'
  21. import {setConfig} from '../src/config/index'
  22. export default {
  23. name: 'App',
  24. components: {HeaderContainer, FooterContainer, HomeSlice},
  25. data(){
  26. return {
  27. // showSlice:false
  28. }
  29. },
  30. methods: {
  31. setUserInfo () {
  32. // storageGet('user').then((res)=>{
  33. // if (res == null){
  34. // this.setCurrUserByHttp()
  35. // }else{
  36. // this.fullScreenLoading = false
  37. // this.isLogin = true
  38. // }
  39. // }).catch((error)=>{
  40. // this.setCurrUserByHttp()
  41. // })
  42. // if (storageGet('user') == null) {
  43. // storageSave('rolesPermissions', {
  44. // 'isRegionManager': false,
  45. // 'isIndividualUser': false,
  46. // 'isEnterpriseUser': false,
  47. // 'isAgency': false,
  48. // 'isSystemAdministrator': false
  49. // })
  50. // console.log('本地没有用户信息,开始加载用户信息')
  51. // getCurrentUser().then((res) => {
  52. // console.log(res)
  53. // storageSave('user', res)
  54. // storageSave('rolesPermissions', getRolesPermissions(res.roleList))
  55. // console.log('用户信息加载成功')
  56. // }).catch(error => {
  57. // console.log('用户信息加载失败')
  58. // if (error.status == 401) {
  59. // notify('warning', error.data)
  60. // } else {
  61. // notify('error', error.data)
  62. // }
  63. // })
  64. // } else {
  65. // this.fullScreenLoading = false
  66. // this.isLogin = true
  67. // }
  68. },
  69. },
  70. computed:{
  71. showSlice(){
  72. if(this.$route.path==='/home' || this.$route.path==='/')
  73. return true;
  74. }
  75. },
  76. }
  77. </script>
  78. <style>
  79. .body-content{
  80. width:100%;
  81. min-width: 1300px;
  82. height: 100%;
  83. }
  84. .container-wrapper {
  85. min-height: calc(100% - 70px - 180px);
  86. }
  87. .main-container {
  88. width: 100%;
  89. min-height: calc(100% - 70px - 180px);
  90. margin: 0 auto;
  91. padding-bottom: 30px;
  92. }
  93. </style>