<template>
    <el-config-provider :locale="zhCn">
        <router-view></router-view>
    </el-config-provider>
</template>

<script lang="ts" setup>
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import useSetTheme from '@/utils/setTheme'
import { onMounted } from 'vue'
useSetTheme()
const fetchMqttUrl = async () => {
    const response = await fetch('/')
    const WebSocketUrl: any = response.headers.get('X-WebSocket-Url')
    const WebSocketUrl2: any = response.headers.get('X-WebSocket-Url2')
    const WebSocketUrl3: any = response.headers.get('X-WebSocket-Url3')
    const MqttUrl: any = response.headers.get('X-MqttUrl-Url')
    localStorage.setItem('WebSocketUrl', WebSocketUrl)
    localStorage.setItem('WebSocketUrl2', WebSocketUrl2)
    localStorage.setItem('WebSocketUrl3', WebSocketUrl3)
    localStorage.setItem('MqttUrl', MqttUrl)
}

onMounted(() => {
    fetchMqttUrl()
})
</script>

<style lang="scss">
/* Your SCSS styles here */
</style>
