Commit 977ac7c4 by 周志凯

[feat]: test api

1 parent 96b889de
......@@ -136,6 +136,7 @@ html, body, #app {
background: #409EFF;
border-radius: inherit;
text-align: right;
transition: width .2s linear;
}
.result-progress__text {
......
apiUrl = 'http://101.201.36.180:9998/',
webSockUrl = ''
\ No newline at end of file
apiUrl = 'http://192.168.9.146:8080/',
webSockUrl = '192.168.9.146:8080'
\ No newline at end of file
......@@ -120,7 +120,14 @@
*/
ws.prototype.open = function() {
var self = this;
wsocket = new WebSocket(this.url, this.protocols || []);
if ("WebSocket" in window) {
wsocket = new WebSocket(this.url, this.protocols || []);
} else if ("MozWebSocket" in window) {
wsocket = new MozWebSocket(this.url, this.protocols || []);
} else {
wsocket = new SockJS(this.url, this.protocols || []);
}
// wsocket = new WebSocket(this.url, this.protocols || []);
eventTarget.dispatchEvent(generateEvent('connecting'));
wsocket.onopen = function(event) {
self.protocols = ws.protocols;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!