修改mqtt连接方式
This commit is contained in:
@@ -790,7 +790,7 @@ const trendRef: any = ref()
|
||||
//暂态事件组件
|
||||
const eventRef: any = ref()
|
||||
const mqttRef = ref()
|
||||
const url: any = inject('MQTTURL')
|
||||
const url: any = window.localStorage.getItem('MQTTURL')
|
||||
const connectMqtt = () => {
|
||||
if (mqttRef.value) {
|
||||
if (mqttRef.value.connected) {
|
||||
@@ -806,6 +806,8 @@ const connectMqtt = () => {
|
||||
username: 't_user',
|
||||
password: 'njcnpqs'
|
||||
}
|
||||
|
||||
|
||||
mqttRef.value = mqtt.connect(url, options)
|
||||
}
|
||||
const getRealDataMqttMsg = async () => {
|
||||
|
||||
Reference in New Issue
Block a user