From 0136630700db56a6287d8bf6b6f00680bdf39a98 Mon Sep 17 00:00:00 2001 From: Xuwznln <18435084+Xuwznln@users.noreply.github.com> Date: Sat, 15 Nov 2025 23:33:02 +0800 Subject: [PATCH] Fix http_client --- unilabos/ros/nodes/presets/host_node.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/unilabos/ros/nodes/presets/host_node.py b/unilabos/ros/nodes/presets/host_node.py index 574a3899..43c34cf9 100644 --- a/unilabos/ros/nodes/presets/host_node.py +++ b/unilabos/ros/nodes/presets/host_node.py @@ -1126,11 +1126,12 @@ class HostNode(BaseROS2DeviceNode): 响应对象,包含查询到的资源 """ try: + from unilabos.app.web import http_client data = json.loads(request.command) if "uuid" in data and data["uuid"] is not None: - http_req = self.bridges[-1].resource_tree_get([data["uuid"]], data["with_children"]) + http_req = http_client.resource_tree_get([data["uuid"]], data["with_children"]) elif "id" in data and data["id"].startswith("/"): - http_req = self.bridges[-1].resource_get(data["id"], data["with_children"]) + http_req = http_client.resource_get(data["id"], data["with_children"]) else: raise ValueError("没有使用正确的物料 id 或 uuid") response.response = json.dumps(http_req["data"])