index.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <!-- -->
  2. <template>
  3. <view class="page-app" >
  4. <view class="page-main">
  5. <view class="page-body">
  6. <!-- 页面内容插槽 -->
  7. <slot />
  8. </view>
  9. </view>
  10. <view class="page-modal">
  11. <!-- 全局授权弹窗 -->
  12. <authModal />
  13. <!-- 全局分享弹窗 -->
  14. <!-- <s-share-modal :shareInfo="shareInfo" /> -->
  15. <!-- 全局快捷入口 -->
  16. <!-- <s-menu-tools /> -->
  17. </view>
  18. </view>
  19. </template>
  20. <script setup>
  21. import authModal from './components/auth-modal.vue'
  22. import { useIM } from '@/hooks/useIM'
  23. import { watch } from 'vue'
  24. import { userStore } from '@/store/user'
  25. const { resetConfig } = useIM()
  26. const useUserStore = userStore()
  27. watch(() => useUserStore.accountInfo.userId, (newVal, oldVal) => {
  28. if (useUserStore.refreshToken) {
  29. // 监听登录状态
  30. resetConfig()
  31. }
  32. })
  33. </script>
  34. <style lang="scss" scoped>
  35. .page-app {
  36. position: relative;
  37. // color: var(--ui-TC);
  38. // background-color: var(--ui-BG-1) !important;
  39. z-index: 2;
  40. display: flex;
  41. width: 100%;
  42. height: 100vh;
  43. .page-main {
  44. position: absolute;
  45. z-index: 1;
  46. width: 100%;
  47. min-height: 100%;
  48. display: flex;
  49. flex-direction: column;
  50. .page-body {
  51. width: 100%;
  52. position: relative;
  53. z-index: 1;
  54. flex: 1;
  55. }
  56. }
  57. }
  58. </style>