| | |
| | | }); |
| | | loginQrCodeKey="loginQrCodeKey_" + MTools.randomStr(); |
| | | let qrInfo={webClientId:webClientId,loginQrCodeKey:loginQrCodeKey} |
| | | console.log(qrInfo); |
| | | qrcode.makeCode(JSON.stringify(qrInfo)); |
| | | $('#qrCodeIcon canvas').show(); |
| | | |
| | |
| | | //实现化WebSocket对象,指定要连接的服务器地址与端口 建立连接 |
| | | let wsPath= getRootPath(); |
| | | var socketUrl= wsPath.replace("http","ws")+ "/webSocketServer?userId="+webClientId; |
| | | console.log(socketUrl); |
| | | |
| | | if(socket!=null){ |
| | | socket.close(); |
| | | socket=null; |
| | |
| | | }; |
| | | //获得消息事件 |
| | | socket.onmessage = function(msg) { |
| | | console.log(msg); |
| | | |
| | | var serverMsg = JSON.parse(msg.data); |
| | | |
| | | if(serverMsg.msgType==1){ |