Commit 977ac7c4 by 周志凯

[feat]: test api

1 parent 96b889de
...@@ -136,6 +136,7 @@ html, body, #app { ...@@ -136,6 +136,7 @@ html, body, #app {
background: #409EFF; background: #409EFF;
border-radius: inherit; border-radius: inherit;
text-align: right; text-align: right;
transition: width .2s linear;
} }
.result-progress__text { .result-progress__text {
......
apiUrl = 'http://101.201.36.180:9998/',
webSockUrl = ''
\ No newline at end of file \ 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 \ No newline at end of file
...@@ -120,7 +120,14 @@ ...@@ -120,7 +120,14 @@
*/ */
ws.prototype.open = function() { ws.prototype.open = function() {
var self = this; var self = this;
if ("WebSocket" in window) {
wsocket = new WebSocket(this.url, this.protocols || []); 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')); eventTarget.dispatchEvent(generateEvent('connecting'));
wsocket.onopen = function(event) { wsocket.onopen = function(event) {
self.protocols = ws.protocols; 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!