From d88e50b8f11f09fe531bfa467745b62c8eb78cf2 Mon Sep 17 00:00:00 2001
From: quanwei <419654421@qq.com>
Date: Sat, 28 Feb 2026 17:54:13 +0800
Subject: [PATCH] 名片聊天实时同步
---
admin/config/business_gateway_worker.php | 7 +++++++
mobile/pages/plus/business/chat/chat.vue | 6 ++++--
admin/config/gateway_worker.php | 6 ++++++
3 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/admin/config/business_gateway_worker.php b/admin/config/business_gateway_worker.php
index 3d42c13..fc58a8b 100644
--- a/admin/config/business_gateway_worker.php
+++ b/admin/config/business_gateway_worker.php
@@ -32,6 +32,7 @@
'lanIp' => '127.0.0.1',
'startPort' => 2100,
'daemonize' => false,
+ 'pidFile' => runtime_path() . 'business_gateway_worker.pid',
'pingInterval' => 30,
'pingNotResponseLimit' => 1,
'pingData' => '',
@@ -42,4 +43,10 @@
'count' => 1,
'eventHandler' => '\app\gateway\BusinessEvents',
],
+
+ // Register配置pid文件
+ 'registerPidFile' => runtime_path() . 'business_gateway_register.pid',
+ 'gatewayPidFile' => runtime_path() . 'business_gateway_gateway.pid',
+ 'businessWorkerPidFile' => runtime_path() . 'business_gateway_business.pid',
+
];
\ No newline at end of file
diff --git a/admin/config/gateway_worker.php b/admin/config/gateway_worker.php
index 4c438dc..c7eebea 100644
--- a/admin/config/gateway_worker.php
+++ b/admin/config/gateway_worker.php
@@ -32,6 +32,7 @@
'lanIp' => '127.0.0.1',
'startPort' => 2000,
'daemonize' => false,
+ 'pidFile' => runtime_path() . 'gateway_worker.pid',
'pingInterval' => 30,
'pingNotResponseLimit' => 1,
'pingData' => '',
@@ -43,4 +44,9 @@
'eventHandler' => '\app\gateway\Events',
],
+ // Register配置pid文件
+ 'registerPidFile' => runtime_path() . 'gateway_register.pid',
+ 'gatewayPidFile' => runtime_path() . 'gateway_gateway.pid',
+ 'businessWorkerPidFile' => runtime_path() . 'gateway_business.pid',
+
];
diff --git a/mobile/pages/plus/business/chat/chat.vue b/mobile/pages/plus/business/chat/chat.vue
index 3c1447c..598b39a 100644
--- a/mobile/pages/plus/business/chat/chat.vue
+++ b/mobile/pages/plus/business/chat/chat.vue
@@ -279,7 +279,7 @@
}, res => {
this.conversationId = res.data.conversation.conversation_id;
this.loadMessages();
- this.wsUrl = res.data.wsUrl;
+ this.wsUrl = 'wss://www.lblmh.com'//res.data.wsUrl;
// 初始化WebSocket连接
this.initWebSocket();
});
@@ -375,13 +375,15 @@
const currentUserId = this.currentUser.user_id;
// 构建WebSocket连接URL - 使用名片聊天专用端口2349
- const wsUrl = `${this.wsUrl}:2349?user_id=${currentUserId}&usertype=supplier `;
+ const wsUrl = `wss://www.lblmh.com/business?user_id=${currentUserId}&usertype=supplier`;
try {
// 创建WebSocket连接
this.socketTask = uni.connectSocket({
url: wsUrl,
success: () => {},
fail: (err) => {
+ console.log(err);
+ console.log(wsUrl);
// 尝试重连
this.reconnectWebSocket();
}
--
Gitblit v1.9.2