设备监控修改
This commit is contained in:
@@ -133,7 +133,7 @@
|
||||
<script setup lang="ts">
|
||||
import DeviceTree from '@/components/tree/govern/deviceTree.vue'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { ref, reactive, watch, onMounted, onBeforeUnmount, h } from 'vue'
|
||||
import { ref, reactive, watch, onMounted, onBeforeUnmount, h, inject } from 'vue'
|
||||
import { ElMessage, ElMessageBox, ElInput } from 'element-plus'
|
||||
import {
|
||||
getDeviceRootPath,
|
||||
@@ -500,7 +500,7 @@ watch(
|
||||
}
|
||||
)
|
||||
const mqttRef = ref()
|
||||
|
||||
const url: any = inject('MQTTURL')
|
||||
const connectMqtt = () => {
|
||||
if (mqttRef.value) {
|
||||
if (mqttRef.value.connected) {
|
||||
@@ -516,9 +516,6 @@ const connectMqtt = () => {
|
||||
username: 't_user',
|
||||
password: 'njcnpqs'
|
||||
}
|
||||
// 线上
|
||||
// const url = 'wss://pqmcn.com:8087/mqtt'
|
||||
const url = 'ws://192.168.1.24:8085/mqtt'
|
||||
mqttRef.value = mqtt.connect(url, options)
|
||||
}
|
||||
connectMqtt()
|
||||
|
||||
Reference in New Issue
Block a user