From 006a23f6edaab91404b2d4591d5d869a6be8b9e9 Mon Sep 17 00:00:00 2001 From: weidong Date: Tue, 2 Jan 2024 19:48:45 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E4=BF=AE=E6=94=B9https=E4=B8=8Bwebso?= =?UTF-8?q?cket=E5=BB=BA=E7=AB=8B=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sec-beidou/src/main/resources/templates/page/cmd_line.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) {