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