diff --git a/web/js/script/main_js.js b/web/js/script/main_js.js index cb79722..49ad9b6 100644 --- a/web/js/script/main_js.js +++ b/web/js/script/main_js.js @@ -37,20 +37,18 @@ define(["js/script/plugin_manager"], let connect_ok = void 0 function websocket(ura){ if("WebSocket" in window) { - var socket = new WebSocket(ura) + let socket = new WebSocket(ura) socket.addEventListener("message",function(event){ console.log('Message from server ', event.data) if (event.data === "{\"code\": 200, \"msg\": \"connect ok\"}"){ - console.info("connect to seriver success") + console.info("connect to server success") connect_ok = 1 }else if (connect_ok === 1) { console.info("cok is "+event.data) let msg = JSON.parse(event.data) - if (msg.message_class === "default"){ - //消息处理 - pm.message_handlers(msg) - } + //消息处理 + pm.message_handlers(msg) } }) socket.onopen=function(){ @@ -58,7 +56,7 @@ function websocket(ura){ } } else { - alert("err! your bloser is not sopported!!!") + alert("err! your browser is not supported!!!") } }