diff --git a/apps/third/king/k.py b/apps/third/king/k.py index acc1f964..28bf9587 100644 --- a/apps/third/king/k.py +++ b/apps/third/king/k.py @@ -47,7 +47,7 @@ class KingClient(HandleLogMixin): **kapis['login'], json=json, timeout=10, need_auth=False, raise_exception=False) if is_ok == "success": current_val = res['Authorization'] - cache.set('king_token', current_val, timeout=None) + cache.set('king_token', current_val, timeout=None) return is_ok, current_val @@ -78,6 +78,7 @@ class KingClient(HandleLogMixin): if 'code' in ret: if ret['code'] != 0: if need_auth and ret['code'] in [-1, -2] and ret['message'] != 'failed': # 认证失败 + # 如果这里没有判断准确,可能会导致多次触发login myLogger.error(f"亚控认证失败: {url}-{ret}") is_ok, _ = self._get_token() if is_ok: