签名步骤

签名步骤

  • 1.签名前数据
{
  "event": "addChannel",
  "channel": "babel_sub_spot_ALL_ALL_login",
"apikey": "thisisyourapikey" }
  • 2.根据key升序排列
{
  "apikey": "thisisyourapikey",
  "channel": "babel_sub_spot_ALL_ALL_login",
"event": "addChannel" }
  • 3.格式化待签名数据并签名
let data = {
             "apikey": "thisisyourapikey",
             "channel": "babel_sub_spot_ALL_ALL_login",
"event": "addChannel" }; let secret = "thisisyourapisecret"; let sign = CryptoJS.HmacMD5(JSON.stringify(data), secret).toString(); // 签名结果 thisissigneddata
  • 4.添加签名结果到请求参数
{
  "event": "addChannel",
  "channel": "babel_sub_spot_ALL_ALL_login",
"apikey": "thisisyourapikey", "sign": "thisissigneddata" }