From e3deb37a47444e2fbf560ba5879944838e392a58 Mon Sep 17 00:00:00 2001 From: zhangx1n Date: Wed, 23 Apr 2025 12:33:24 +0800 Subject: [PATCH] chore: update send_request method to handle tenant_id in params --- api/services/enterprise/base.py | 6 +++--- api/services/enterprise/enterprise_service.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/services/enterprise/base.py b/api/services/enterprise/base.py index d0464834ce..ad526d5f34 100644 --- a/api/services/enterprise/base.py +++ b/api/services/enterprise/base.py @@ -13,10 +13,10 @@ class EnterpriseRequest: } @classmethod - def send_request(cls, method, endpoint, json=None, params=None, tenant_id=None): + def send_request(cls, method, endpoint, json=None, params=None): headers = {"Content-Type": "application/json", "Enterprise-Api-Secret-Key": cls.secret_key} - if tenant_id: - headers["X-Tenant-ID"] = tenant_id + if params["tenant_id"]: + headers["X-Tenant-ID"] = params["tenant_id"] url = f"{cls.base_url}{endpoint}" response = requests.request(method, url, json=json, params=params, headers=headers, proxies=cls.proxies) return response.json() diff --git a/api/services/enterprise/enterprise_service.py b/api/services/enterprise/enterprise_service.py index a1b6216b25..0e1e6c2500 100644 --- a/api/services/enterprise/enterprise_service.py +++ b/api/services/enterprise/enterprise_service.py @@ -16,7 +16,7 @@ class WebAppSettings(BaseModel): class EnterpriseService: @classmethod def get_info(cls, tenant_id=None): - return EnterpriseRequest.send_request("GET", "/info", tenant_id=tenant_id) + return EnterpriseRequest.send_request("GET", "/info", params={"tenant_id": tenant_id}) class WebAppAuth: @classmethod