Browse Source

提交代码。

Signed-off-by: zouap <zouap@pcl.ac.cn>
pull/1316/head
zouap 3 years ago
parent
commit
04d357f617
1 changed files with 8 additions and 2 deletions
  1. +8
    -2
      public/home/home.js

+ 8
- 2
public/home/home.js View File

@@ -33,8 +33,14 @@ var swiperRepo = new Swiper(".homepro-list", {
}); });


var output = document.getElementById("newmessage"); var output = document.getElementById("newmessage");
var socket = new WebSocket("ws://" + document.location.host + "/action/notification");
var messageQueue = [];
console.log("document.location.host="+document.location.host);
console.log("document.URL="+document.URL);
var url = "ws://" + document.location.host + "/action/notification";
if(document.location.host == "git.openi.org.cn" || document.URL.startsWith("https")){
url = "wss://" + document.location.host + "/action/notification"
}
var socket = new WebSocket(url);

socket.onopen = function () { socket.onopen = function () {
messageQueue = []; messageQueue = [];
console.log("message has connected."); console.log("message has connected.");


Loading…
Cancel
Save