App.vue 1.9 KB

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