fix: 修复演示页面加载出错
This commit is contained in:
parent
245410c149
commit
1f616d1d1d
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<component
|
<component
|
||||||
v-if="chat_show"
|
v-if="chat_show && init_data_end"
|
||||||
:applicationAvailable="applicationAvailable"
|
:applicationAvailable="applicationAvailable"
|
||||||
:is="currentTemplate"
|
:is="currentTemplate"
|
||||||
:application_profile="application_profile"
|
:application_profile="application_profile"
|
||||||
@ -15,7 +15,7 @@
|
|||||||
></Auth>
|
></Auth>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, computed } from 'vue'
|
import { ref, onBeforeMount, computed } from 'vue'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import useStore from '@/stores'
|
import useStore from '@/stores'
|
||||||
import Auth from '@/views/chat/auth/index.vue'
|
import Auth from '@/views/chat/auth/index.vue'
|
||||||
@ -79,16 +79,16 @@ function getAppProfile() {
|
|||||||
}
|
}
|
||||||
function getAccessToken(token: string) {
|
function getAccessToken(token: string) {
|
||||||
return application.asyncAppAuthentication(token, loading).then(() => {
|
return application.asyncAppAuthentication(token, loading).then(() => {
|
||||||
getAppProfile()
|
return getAppProfile()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
onMounted(() => {
|
onBeforeMount(() => {
|
||||||
Promise.all([user.changeUserType(2), getAccessToken(accessToken)])
|
user.changeUserType(2)
|
||||||
|
Promise.all([user.asyncGetProfile(), getAccessToken(accessToken)])
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
applicationAvailable.value = false
|
applicationAvailable.value = false
|
||||||
})
|
})
|
||||||
.finally(() => (init_data_end.value = true))
|
.finally(() => (init_data_end.value = true))
|
||||||
user.asyncGetProfile()
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss"></style>
|
<style lang="scss"></style>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user