Fixed a bug caused by url containing hashes

This commit is contained in:
Sheng
2019-04-27 00:01:48 +08:00
parent 7ddce5a105
commit d69d8cfa7a
+1 -1
View File
@@ -210,7 +210,7 @@ jQuery(function($){
return; return;
} }
var ws_url = window.location.href.split('?')[0].replace('http', 'ws'), var ws_url = window.location.href.split(/\?|#/, 1)[0].replace('http', 'ws'),
join = (ws_url[ws_url.length-1] === '/' ? '' : '/'), join = (ws_url[ws_url.length-1] === '/' ? '' : '/'),
url = ws_url + join + 'ws?id=' + msg.id, url = ws_url + join + 'ws?id=' + msg.id,
sock = new window.WebSocket(url), sock = new window.WebSocket(url),