Files
admin-govern/src/App.vue

40 lines
855 B
Vue
Raw Normal View History

2023-12-21 16:42:39 +08:00
<template>
2024-01-30 13:47:03 +08:00
<el-config-provider :locale="zhCn">
2023-12-26 16:17:30 +08:00
<router-view></router-view>
</el-config-provider>
2023-12-21 16:42:39 +08:00
</template>
2023-12-26 16:17:30 +08:00
2024-01-30 13:47:03 +08:00
<script lang="ts" setup>
2023-12-26 16:17:30 +08:00
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
2024-01-30 13:47:03 +08:00
import useSetTheme from '@/utils/setTheme'
2024-12-30 10:07:26 +08:00
import { provide, onMounted, ref } from 'vue'
2024-10-15 15:30:01 +08:00
//线上mqtt
2024-12-30 10:07:26 +08:00
let buildUrl = 'wss://pqmcn.com:8087/mqtt'//102
// let buildUrl = 'ws://pqmcn.com:8073/mqtt'//27
// 从 Nginx 获取 MQTT URL
const fetchMqttUrl = async () => {
const response = await fetch('/')
const mqttUrl = response.headers.get('X-MQTT-URL')
window.localStorage.setItem('MQTTURL', mqttUrl || buildUrl)
}
2024-10-15 15:30:01 +08:00
//本地mqtt
2024-12-30 10:07:26 +08:00
// let devUrl = 'ws://192.168.1.24:8085/mqtt'
onMounted(() => {
fetchMqttUrl()
})
// provide('MQTTURL', buildUrl.value)
2024-01-30 13:47:03 +08:00
useSetTheme()
2023-12-26 16:17:30 +08:00
</script>
2023-12-28 14:49:48 +08:00
2024-01-30 13:47:03 +08:00
<style lang="scss">
/* Your SCSS styles here */
2023-12-28 14:49:48 +08:00
</style>