1
|
1
|
import { h, render } from 'vue'
|
2
|
2
|
import { useParseParams, usePlatform } from '..'
|
3
|
|
-import { checkShareModeNeedPassword, getConfigurationContent as getContent, getShareDataByAccessCredentials, getShareToken, saveConfigurationContent as saveData } from '@/api/content'
|
|
3
|
+import { checkShareModeNeedPassword, doAppLogin, getConfigurationContent as getContent, getShareDataByAccessCredentials, getShareToken, saveConfigurationContent as saveData } from '@/api/content'
|
4
|
4
|
import type { ConfigurationContentType } from '@/api/content/model'
|
5
|
5
|
import { ShareLoginModal } from '@/core/Share'
|
6
|
6
|
import { PageModeEnum } from '@/enums/modeEnum'
|
...
|
...
|
@@ -11,7 +11,7 @@ import { MessageEnum } from '@/enums/messageEnum' |
11
|
11
|
|
12
|
12
|
export function useContentData() {
|
13
|
13
|
const contentDataStore = useContentDataStoreWithOut()
|
14
|
|
- const { mode, publicId, configurationId } = useParseParams()
|
|
14
|
+ const { mode, publicId, configurationId, userId } = useParseParams()
|
15
|
15
|
const userStore = useUserStoreWithOut()
|
16
|
16
|
const { createMessage } = useMessage()
|
17
|
17
|
|
...
|
...
|
@@ -37,6 +37,11 @@ export function useContentData() { |
37
|
37
|
}
|
38
|
38
|
|
39
|
39
|
const doGetConfigurationContent = async () => {
|
|
40
|
+ if (userId) {
|
|
41
|
+ const { token, refreshToken } = await doAppLogin(userId)
|
|
42
|
+ userStore.storeToken(token, refreshToken)
|
|
43
|
+ }
|
|
44
|
+
|
40
|
45
|
const result = mode === PageModeEnum.SHARE ? await shareModeBootstrap() : await getContent()
|
41
|
46
|
|
42
|
47
|
if (result) {
|
...
|
...
|
|