mirror of https://github.com/jumpserver/jumpserver
test
parent
b0d1dd9485
commit
5f35b740df
|
@ -36,13 +36,12 @@ WSSHClient.prototype.connect = function (options) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this._connection.onmessage = function (evt) {
|
this._connection.onmessage = function (evt) {
|
||||||
var data = JSON.parse(evt.data.toString());
|
try{
|
||||||
if (data.error !== undefined) {
|
options.onData(evt.data);
|
||||||
|
} catch (e) {
|
||||||
|
var data = JSON.parse(evt.data.toString());
|
||||||
options.onError(data.error);
|
options.onError(data.error);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
options.onData(data);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this._connection.onclose = function (evt) {
|
this._connection.onclose = function (evt) {
|
||||||
|
|
Loading…
Reference in New Issue