触控接口

This commit is contained in:
chenbo 2024-01-16 11:49:21 +08:00
parent b32be670f5
commit b05eb8fdd3

View File

@ -14,7 +14,7 @@ hello <span id="text1">123</span>
<script> <script>
// 建立连接 // 建立连接
var connection = new Push({ var connection = new Push({
url: 'ws://192.168.1.21:3131', // websocket地址 url: 'ws://192.168.1.24:3131', // websocket地址
app_key: 'aaea61749929eb53a4bd75a1474c1d27', app_key: 'aaea61749929eb53a4bd75a1474c1d27',
}); });
// 假设用户uid为1 // 假设用户uid为1
@ -29,9 +29,11 @@ hello <span id="text1">123</span>
document.getElementById('text1').innerHTML = data.content.name; document.getElementById('text1').innerHTML = data.content.name;
}); });
// 断线事件 // 断线事件
user_channel.on('close', function() { user_channel.on('close', function(data) {
console.log('断线了');
console.log(data);
}); });
</script> </script>
</body> </body>
</html> </html>