|
@@ -417,20 +417,6 @@ export default {
|
|
|
},
|
|
|
// mqtt相关方法
|
|
|
connectMQTTwo() {
|
|
|
- // if (this.mqttClientTwo && this.mqttClientTwo.connected) {
|
|
|
- // console.log("MQTT连接已存在,无需重新创建", this.mqttClientTwo);
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // if (this.mqttClientTwo) {
|
|
|
- // try {
|
|
|
- // this.mqttClientTwo.end();
|
|
|
- // this.mqttClientTwo = null;
|
|
|
- // console.log("清理旧MQTT连接");
|
|
|
- // } catch (e) {
|
|
|
- // console.error("清理连接时出错:", e);
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
if (this.mqttClientFlag) {
|
|
|
console.log("主题已订阅");
|
|
|
return;
|
|
@@ -463,14 +449,14 @@ export default {
|
|
|
let selectedService = uni.getStorageSync("sercviceChoice");
|
|
|
if (!selectedService || selectedService == "aloneServe") {
|
|
|
if (__wxConfig.envVersion == "develop") {
|
|
|
- client = mqtt.connect(
|
|
|
- "wxs://api.radar-power.asia:8084/mqtt",
|
|
|
- params
|
|
|
- );
|
|
|
// client = mqtt.connect(
|
|
|
- // "wxs://radar-power.cn:8084/mqtt",
|
|
|
+ // "wxs://api.radar-power.asia:8084/mqtt",
|
|
|
// params
|
|
|
// );
|
|
|
+ client = mqtt.connect(
|
|
|
+ "wxs://radar-power.cn:8084/mqtt",
|
|
|
+ params
|
|
|
+ );
|
|
|
}
|
|
|
if (__wxConfig.envVersion == "trial") {
|
|
|
client = mqtt.connect(
|