getters.js 1.0 KB

1234567891011121314151617181920212223242526272829
  1. const getters = {
  2. sidebar: state => state.app.sidebar,
  3. size: state => state.app.size,
  4. device: state => state.app.device,
  5. visitedViews: state => state.tagsView.visitedViews,
  6. cachedViews: state => state.tagsView.cachedViews,
  7. token: state => state.user.token,
  8. avatar: state => state.user.avatar,
  9. name: state => state.user.name,
  10. introduction: state => state.user.introduction,
  11. roles: state => state.user.roles,
  12. permissions: state => state.user.permissions,
  13. permission_routes: state => state.permission.routes,
  14. topbarRouters:state => state.permission.topbarRouters,
  15. defaultRoutes:state => state.permission.defaultRoutes,
  16. sidebarRouters:state => state.permission.sidebarRouters,
  17. userID: state => state.imuser.userID,
  18. userSig: state => state.imuser.userSig,
  19. sdkAppID: state => state.imuser.sdkAppID,
  20. hidden(state) {
  21. // eslint-disable-next-line no-unused-vars
  22. const temp = state.current
  23. if (typeof document.hasFocus !== 'function') {
  24. return document.hidden
  25. }
  26. return !document.hasFocus()
  27. }
  28. }
  29. export default getters