Commit eda4717b by ken

balance

parent b5c382c7
......@@ -27,8 +27,8 @@ const _handleSocketOpen = function(opened_callback) {
this.send(JSON.stringify(req));
}
let accountReq = `{"accesskey":"${APIKEY}","channel":"${accountInfoChannel}","event":"addChannel"}`;
const sign = crypto.createHmac('sha1', APISECRET).update(accountReq).digest().toString('base64');
accountReq = accountReq.replace('}', `,'sign':'${sign}'}`);
const sign = crypto.createHmac('sha1', APISECRET).update(accountReq).digest("hex").toString('base64');
accountReq = accountReq.replace('}', `,"sign":"${sign}"}`);
console.log(accountReq);
this.send(accountReq);
};
......
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