App.vue 1.9 KB

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