1
|
1
|
<template>
|
2
|
2
|
<section>
|
3
|
3
|
<preview v-if="!allowLoadPreviewPage" :key="key"></preview>
|
4
|
|
- <NModal :show="allowLoadPreviewPage" :maskClosable="false" :closable="false" style="width: 300px;">
|
|
4
|
+ <NModal :show="showModal" :maskClosable="false" :closable="false" style="width: 300px;">
|
5
|
5
|
<NCard>
|
6
|
6
|
<NForm @keyup.enter="handleSubmit">
|
7
|
7
|
<NFormItem label="访问令牌">
|
...
|
...
|
@@ -31,6 +31,7 @@ import { checkSharePageNeedAccessToken, getPublicToken, getShareContentData } fr |
31
|
31
|
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
|
32
|
32
|
|
33
|
33
|
const allowLoadPreviewPage = ref(true)
|
|
34
|
+const showModal = ref(false)
|
34
|
35
|
const ROUTE = useRoute()
|
35
|
36
|
const accessCredentials = ref('')
|
36
|
37
|
const loading = ref(false)
|
...
|
...
|
@@ -54,8 +55,11 @@ const checkNeedAccessToken = async () => { |
54
|
55
|
const sharePageHandlerProcess = async () => {
|
55
|
56
|
await getToken()
|
56
|
57
|
const flag = await checkNeedAccessToken()
|
57
|
|
- if (!flag) {
|
|
58
|
+ if (flag) {
|
|
59
|
+ showModal.value = true
|
|
60
|
+ } else {
|
58
|
61
|
allowLoadPreviewPage.value = false
|
|
62
|
+ await getSharePageContentData()
|
59
|
63
|
}
|
60
|
64
|
}
|
61
|
65
|
|
...
|
...
|
@@ -73,6 +77,7 @@ const getSharePageContentData = async () => { |
73
|
77
|
chartEditStore.requestGlobalConfig = requestGlobalConfig
|
74
|
78
|
chartEditStore.componentList = componentList
|
75
|
79
|
}
|
|
80
|
+ showModal.value = false
|
76
|
81
|
allowLoadPreviewPage.value = false
|
77
|
82
|
} catch (error) {
|
78
|
83
|
console.log(error)
|
...
|
...
|
|