Commit a4c2a641 by ken

试试看

parent 7d0494fc
...@@ -81,6 +81,7 @@ const _subscribe = function(callback, opened_callback = false) { ...@@ -81,6 +81,7 @@ const _subscribe = function(callback, opened_callback = false) {
ws.on('close', _handleSocketClose.bind(ws)); ws.on('close', _handleSocketClose.bind(ws));
ws.on('message', function(data) { ws.on('message', function(data) {
try { try {
console.log(JSON.parse(data));
callback(JSON.parse(data)); callback(JSON.parse(data));
} catch (error) { } catch (error) {
console.log('Parse error: '+error.message); console.log('Parse error: '+error.message);
...@@ -91,7 +92,6 @@ const _subscribe = function(callback, opened_callback = false) { ...@@ -91,7 +92,6 @@ const _subscribe = function(callback, opened_callback = false) {
function subscribe() { function subscribe() {
_subscribe((data) => { _subscribe((data) => {
console.log(data);
if (data.channel === accountInfoChannel) { if (data.channel === accountInfoChannel) {
const coins = data.data.coins; const coins = data.data.coins;
const balances = {}; const balances = {};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment