diff --git a/sec-beidou/src/main/resources/templates/page/cmd_line.html b/sec-beidou/src/main/resources/templates/page/cmd_line.html index 7a116e30..3ce2d767 100644 --- a/sec-beidou/src/main/resources/templates/page/cmd_line.html +++ b/sec-beidou/src/main/resources/templates/page/cmd_line.html @@ -117,8 +117,10 @@ function connectWebSocket() { //获取当前网址,如: http://localhost:8080/ems/Pages/Basic/Person.jsp var curPath = window.document.location.href; + console.log(curPath); //获取主机地址之后的目录,如: /ems/Pages/Basic/Person.jsp var pathName = window.document.location.pathname; + console.log(curPath); var pos = curPath.indexOf(pathName); //获取主机地址,如: http://localhost:8080 var basePath = curPath.substring(0, pos); @@ -134,7 +136,7 @@ } websocket.onerror = function (){ console.log("Socket error"); - layui.alert("Open web socket failed!"); + layui.layer.alert("Open web socket failed!"); } //接收信息 websocket.onmessage = function (event) {