fix client init
This commit is contained in:
parent
4d38a74306
commit
90dcd3b23e
5
app.vue
5
app.vue
@ -5,3 +5,8 @@
|
||||
</NuxtLayout>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
const configStore = useConfig()
|
||||
|
||||
await useAsyncData('init', () => configStore.configInit())
|
||||
</script>
|
||||
|
@ -14,14 +14,11 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
const colorMode = useColorMode()
|
||||
const configStore = useConfig()
|
||||
const authStore = useAuth()
|
||||
const indexStore = useIndex()
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
await configStore.nuxtClientInit()
|
||||
|
||||
if (colorMode.value === 'dark') {
|
||||
indexStore.darkMode = true
|
||||
} else {
|
||||
|
@ -20,14 +20,14 @@ export const useConfig = defineStore('config', {
|
||||
|
||||
getters: {},
|
||||
actions: {
|
||||
async nuxtClientInit() {
|
||||
async configInit() {
|
||||
const authStore = useAuth()
|
||||
|
||||
authStore.inspectToken()
|
||||
|
||||
if (authStore.isLogin) {
|
||||
await authStore.obtainUuid()
|
||||
this.getChannelConfig().then(async () => {
|
||||
await this.getChannelConfig().then(async () => {
|
||||
await this.getPlayoutConfig()
|
||||
await this.getUserConfig()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user