添加模拟射箭按钮

This commit is contained in:
kron
2025-06-08 13:55:09 +08:00
parent deff79aa7b
commit 312906fec3
5 changed files with 46 additions and 7 deletions

View File

@@ -20,10 +20,12 @@ function createWebSocket(token, onMessage) {
console.error("WebSocket 错误", err);
});
// 关闭处理
uni.onSocketClose((result) => {
console.log("WebSocket 已关闭", result);
stopHeartbeat();
socket = uni.connectSocket({
url: `ws://120.79.241.5:8000/socket?authorization=${token}`,
success: () => console.log("websocket 连接成功"),
});
});
// 启动心跳