mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-14 17:45:57 +08:00
feat(license): refactor available team members handling in feature service.
- add tenant_id support to info request methods
This commit is contained in:
parent
3603418bc6
commit
2e419ca3ba
@ -13,8 +13,10 @@ class EnterpriseRequest:
|
||||
}
|
||||
|
||||
@classmethod
|
||||
def send_request(cls, method, endpoint, json=None, params=None):
|
||||
def send_request(cls, method, endpoint, json=None, params=None, tenant_id=None):
|
||||
headers = {"Content-Type": "application/json", "Enterprise-Api-Secret-Key": cls.secret_key}
|
||||
if tenant_id:
|
||||
headers["X-Tenant-ID"] = 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()
|
||||
|
@ -1,10 +1,13 @@
|
||||
from contexts import tenant_id
|
||||
from services.enterprise.base import EnterpriseRequest
|
||||
from flask import request
|
||||
from libs.passport import PassportService
|
||||
|
||||
|
||||
class EnterpriseService:
|
||||
@classmethod
|
||||
def get_info(cls):
|
||||
return EnterpriseRequest.send_request("GET", "/info")
|
||||
def get_info(cls, tenant_id=None):
|
||||
return EnterpriseRequest.send_request("GET", "/info", tenant_id=tenant_id)
|
||||
|
||||
@classmethod
|
||||
def get_app_web_sso_enabled(cls, app_code):
|
||||
|
Loading…
x
Reference in New Issue
Block a user