Commit 35c42ff7e8a8dc1ca274f5a6c53f19bf86814566
1 parent
d0e3467d
修改
Showing
2 changed files
with
1 additions
and
3 deletions
src/main/java/com/cnlive/shenhe/logging/logging.java
| @@ -31,7 +31,6 @@ public class logging { | @@ -31,7 +31,6 @@ public class logging { | ||
| 31 | @GetMapping("/") | 31 | @GetMapping("/") |
| 32 | public ModelAndView logging( Model model) { | 32 | public ModelAndView logging( Model model) { |
| 33 | model.addAttribute("port", port); | 33 | model.addAttribute("port", port); |
| 34 | - logger.info("port", port); | ||
| 35 | return new ModelAndView("logging/logging.html"); | 34 | return new ModelAndView("logging/logging.html"); |
| 36 | } | 35 | } |
| 37 | } | 36 | } |
src/main/resources/templates/logging/logging.html
| @@ -33,10 +33,9 @@ | @@ -33,10 +33,9 @@ | ||
| 33 | let websocket = null; | 33 | let websocket = null; |
| 34 | var re=location.origin; | 34 | var re=location.origin; |
| 35 | console.log(re); | 35 | console.log(re); |
| 36 | - alert("ws://localhost:"+[[${port}]]+"/logging/websocket"); | ||
| 37 | //判断当前浏览器是否支持WebSocket | 36 | //判断当前浏览器是否支持WebSocket |
| 38 | if ('WebSocket' in window) { | 37 | if ('WebSocket' in window) { |
| 39 | - websocket = new WebSocket("ws://localhost:"+[[${port}]]+"/logging/websocket"); | 38 | + websocket = new WebSocket("ws://"+re+"/logging/websocket"); |
| 40 | } else { | 39 | } else { |
| 41 | console.error("不支持WebSocket"); | 40 | console.error("不支持WebSocket"); |
| 42 | } | 41 | } |