From 85a15646ffe20ed2bbb2042ec500df8c850a69cc Mon Sep 17 00:00:00 2001
From: zhuguifei <zhuguifei@zhuguifeideiMac.local>
Date: 星期五, 25 七月 2025 15:29:41 +0800
Subject: [PATCH] 首次提交
---
mqtt/MqttView.vue | 32 +++++++++++++++++++++++++++++---
1 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/mqtt/MqttView.vue b/mqtt/MqttView.vue
index 94f4b88..2d6c7d4 100644
--- a/mqtt/MqttView.vue
+++ b/mqtt/MqttView.vue
@@ -41,10 +41,13 @@
}
let opts = {
// #ifdef H5
- url: 'ws://' + this.$api.mqttBaseUrl + ':8083/mqtt',
+ url: 'wss://' + this.$api.mqttBaseUrl + ':8084/mqtt',
// #endif
- // #ifdef APP-PLUS
- url: 'wx://' + this.$api.mqttBaseUrl + ':8083/mqtt',
+ // #ifdef MP-WEIXIN
+ url: 'wxs://' + this.$api.mqttBaseUrl + ':8084/mqtt',// 寰俊灏忕▼搴忓己鍒� WSS
+ // #endif
+ // #ifdef APP-PLUS
+ url: 'wxs://' + this.$api.mqttBaseUrl + ':8084/mqtt', // Android/iOS 鐢ㄦ櫘閫� WebSocket
// #endif
clientId: deviceid,
username: account.username,
@@ -76,6 +79,29 @@
}).then(res => {
console.error(res)
})
+
+ //璁㈤槄骞茬嚗璁惧杩炴帴鏂紑鐘舵�佹洿鏂�-绉熸埛鍐呮墍鏈夎澶�
+ this.$mqttTool.subscribe({
+ topic: this.$constant.SERVICE_BROADCAST_TENANT_UPDATE_EQU_STATU.replace('%s', this.tenantId),
+ qos: 0
+ }).then(res => {
+ console.error(res)
+ })
+ //璁㈤槄鏌ヨ骞茬嚗璁惧杩炴帴鐘舵��-鍗曚釜璁惧
+ this.$mqttTool.subscribe({
+ topic: this.$constant.SERVICE_RES_EQU_STATU.replace('%s', deviceid),
+ qos: 0
+ }).then(res => {
+ console.error(res)
+ })
+
+ //璁㈤槄骞茬嚗璁惧瀹炴椂鏁版嵁
+ this.$mqttTool.subscribe({
+ topic: this.$constant.SERVICE_BROADCAST_TENANT_REAL_DATA.replace('%s', this.tenantId),
+ qos: 0
+ }).then(res => {
+ console.error(res)
+ })
//璁㈤槄鍙戦�佹寚浠よ繑鍥炵粨鏋�
// this.$mqttTool.subscribe({
--
Gitblit v1.9.3