Browse Source

htx 订阅bug修复

hl 1 year ago
parent
commit
1bf2521812
1 changed files with 4 additions and 2 deletions
  1. 4 2
      exchanges/src/htx_swap_ws.rs

+ 4 - 2
exchanges/src/htx_swap_ws.rs

@@ -430,12 +430,14 @@ impl HtxSwapWs {
                 res_data.message = "订阅成功".to_string();
                 return res_data;
             }
-            "notify" =>{
+            "notify" => {
                 res_data.channel = json_value["topic"].as_str().unwrap().to_string();
                 res_data.code = 200;
                 res_data.message = "推送数据".to_string();
-                if json_value.get("data").is_some(){
+                if json_value.get("data").is_some() {
                     res_data.data = json_value["data"].clone();
+                } else {
+                    res_data.data = json_value.clone();
                 }
 
                 return res_data;