优化代客下单选择用户重复连接ws的问题

This commit is contained in:
gyq
2025-11-18 16:14:26 +08:00
parent 70f46a61c1
commit 606d0da349
2 changed files with 8 additions and 5 deletions

View File

@@ -841,8 +841,6 @@ export const useCartsStore = defineStore("carts", () => {
$initParams = initParams;
}
concocatSocket($initParams);
}
@@ -971,7 +969,12 @@ export const useCartsStore = defineStore("carts", () => {
if (msg.operate_type === "bulk_edit") {
msg.operate_type = 'manage_' + msg.operate_type;
concocatSocket({ ...$initParams, table_code: table_code.value });
console.log('WebSocketManager.connected===', WebSocketManager.connected);
if (WebSocketManager.connected) {
WebSocketManager.sendMessage({ ...$initParams, table_code: table_code.value })
} else {
concocatSocket({ ...$initParams, table_code: table_code.value });
}
}
});
}