From 8fe20699481f29827f1677d14da987df901bc074 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 23 Apr 2024 15:00:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BA=9A=E6=8E=A7=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/third/king/k.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/third/king/k.py b/apps/third/king/k.py index ab421225..565496fb 100644 --- a/apps/third/king/k.py +++ b/apps/third/king/k.py @@ -9,7 +9,7 @@ from rest_framework.exceptions import APIException, ParseError from apps.third.errors import KING_REQUEST_ERROR from apps.utils.tools import print_roundtrip from django.utils.timezone import now -from apps.third.king import king_api +from apps.third.king.king_api import kapis from apps.utils.tools import singleton from django.core.cache import cache from apps.third.mixins import HandleLogMixin @@ -34,7 +34,7 @@ class KingClient(HandleLogMixin): king_token = cache.get('king_token', None) if king_token: is_ok, _ = self.request( - **king_api['heartbeat'], headers={'Authorization': king_token}, raise_exception=False, timeout=10) + **kapis['heartbeat'], headers={'Authorization': king_token}, raise_exception=False, timeout=10) if is_ok == 'success': return json = { @@ -42,7 +42,7 @@ class KingClient(HandleLogMixin): 'password': settings.KING_PASSWORD } _, res = self.request( - **king_api['login'], json=json, timeout=10) + **kapis['login'], json=json, timeout=10) cache.set('king_token', res['Authorization'], timeout=None) def request(self, url: str, method: str = 'post', params=dict(), json=dict(), timeout=20, raise_exception=True):