diff --git a/apps/gsekit/apps.py b/apps/gsekit/apps.py index f6e6bfd..66d0970 100644 --- a/apps/gsekit/apps.py +++ b/apps/gsekit/apps.py @@ -41,7 +41,7 @@ def connect_signals(): @staticmethod def fetch_esb_api_key(): - from apps.api import EsbApi + from blueapps.utils import get_client_by_user from apps.gsekit.meta.models import GlobalSettings if settings.IS_LOCAL: @@ -59,7 +59,8 @@ def fetch_esb_api_key(): print(message, flush=True) logger.info(message) else: - esb_result = EsbApi.get_api_public_key({"no_request": True}) + client = get_client_by_user(user_or_username=settings.BK_ADMIN_USERNAME) + esb_result = client.esb.get_api_public_key() if esb_result["result"]: api_public_key = esb_result["data"]["public_key"] settings.APIGW_PUBLIC_KEY = api_public_key diff --git a/blueking/component/conf.py b/blueking/component/conf.py index c30fc0b..9f0362f 100644 --- a/blueking/component/conf.py +++ b/blueking/component/conf.py @@ -8,7 +8,7 @@ APP_CODE = settings.APP_ID SECRET_KEY = settings.APP_TOKEN - COMPONENT_SYSTEM_HOST = getattr(settings, "BK_PAAS_INNER_HOST", settings.BK_PAAS_HOST) + COMPONENT_SYSTEM_HOST = settings.BK_COMPONENT_API_URL DEFAULT_BK_API_VER = getattr(settings, "DEFAULT_BK_API_VER", "v2") except Exception: APP_CODE = ""