index.vue
1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<script lang="ts" setup>
  import { onMounted } from 'vue';
  import { Spin } from 'ant-design-vue';
  import { ref } from 'vue';
  import { useRoute } from 'vue-router';
  import { useUserStore } from '/@/store/modules/user';
  import BoardDetail from '/@/views/visual/board/detail/index.vue';
  import { doAppLogin } from '/@/api/sys/user';
  const loading = ref(true);
  const ROUTE = useRoute();
  const contentData = ref<any>();
  const canLoadComponent = ref(false);
  const modelVisable = ref(false);
  const userStore = useUserStore();
  const getShareToken = async () => {
    const { params } = ROUTE;
    const { userId }: any = params;
    const { token, refreshToken } = await doAppLogin(userId);
    userStore.storeToken(token, refreshToken);
  };
  const getContentLoading = ref(false);
  const getContentData = async () => {
    try {
      getContentLoading.value = true;
      loading.value = false;
      canLoadComponent.value = true;
      modelVisable.value = false;
    } catch (error) {
    } finally {
      getContentLoading.value = false;
    }
  };
  onMounted(async () => {
    await getShareToken();
    await getContentData();
  });
</script>
<template>
  <Spin
    :spinning="loading"
    tip="正在加载中..."
    size="large"
    class="!flex justify-center items-center w-full h-full share-full-loading"
  >
    <BoardDetail v-if="canLoadComponent" :value="contentData" />
  </Spin>
</template>
<style lang="less">
  .share-page-token-modal {
    .ant-modal-close {
      display: none;
    }
  }
</style>