diff --git a/backend/app/crypto_agent/executor/base_executor.py b/backend/app/crypto_agent/executor/base_executor.py index e2c4f87..e03b10d 100644 --- a/backend/app/crypto_agent/executor/base_executor.py +++ b/backend/app/crypto_agent/executor/base_executor.py @@ -474,7 +474,7 @@ class BaseExecutor(ABC): try: success = result.get('success', False) order_id = result.get('order_id', '') - error_msg = result.get('error', '') + error_msg = result.get('error', result.get('message', '')) # 根据操作类型选择通知方法 if operation == 'OPEN': @@ -501,7 +501,7 @@ class BaseExecutor(ABC): """发送开仓通知""" success = result.get('success', False) order_id = result.get('order_id', '') - error_msg = result.get('error', '') + error_msg = result.get('error', result.get('message', '')) if success: # 成功开仓 @@ -599,7 +599,7 @@ class BaseExecutor(ABC): """发送撤单通知""" success = result.get('success', False) order_id = result.get('order_id', '') - error_msg = result.get('error', '') + error_msg = result.get('error', result.get('message', '')) if success: title = f"✅ [{self.platform_name}] 撤单成功 - {symbol}" diff --git a/backend/app/crypto_agent/executor/hyperliquid_executor.py b/backend/app/crypto_agent/executor/hyperliquid_executor.py index 84e9fd8..deaf209 100644 --- a/backend/app/crypto_agent/executor/hyperliquid_executor.py +++ b/backend/app/crypto_agent/executor/hyperliquid_executor.py @@ -164,6 +164,8 @@ class HyperliquidExecutor(BaseExecutor): """执行撤单""" try: result = self.hyperliquid.cancel_order(symbol.replace('USDT', ''), order_id) + if not result.get('order_id'): + result['order_id'] = order_id logger.info(f" ✅ 撤单成功: {order_id}") # 发送飞书通知