更新多个用户连接同一个设备的通知

This commit is contained in:
wyf
2025-07-15 10:59:41 +08:00
parent a8b0723714
commit 35cf04b580
6 changed files with 93 additions and 15 deletions

View File

@@ -177,6 +177,10 @@ void initEasyDartModule() {
WebSocketConfig(ServiceConstant.webSocketService, (data) {
// 接收到服务消息
var json = jsonDecode(data);
ef.log("[websokcet]:${json}");
if (json['wsId'] != null) {
ef.kvRoot.websocketId = json['wsId'];
}
if (json['code'] != null && json['code'] != 200) {
EasyDartModule.logger.error("websocket连接失败--》" + json);
}
@@ -184,7 +188,11 @@ void initEasyDartModule() {
var call = CommonVariables.callMap[json["path"]];
if (call != null) {
try {
call(json["data"]);
if (json['path'] != "/smartbed/connect") {
call(json["data"]);
} else {
call(json);
}
} catch (e) {
print(e);
}