From ed05083bbed5ab472e0243641587a9d9caa61272 Mon Sep 17 00:00:00 2001 From: youngS Date: Mon, 13 Sep 2021 18:19:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BC=82=E5=B8=B8bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fir_ser/api/utils/mp/wechat.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fir_ser/api/utils/mp/wechat.py b/fir_ser/api/utils/mp/wechat.py index 7c3cc72..4c9be20 100644 --- a/fir_ser/api/utils/mp/wechat.py +++ b/fir_ser/api/utils/mp/wechat.py @@ -18,7 +18,7 @@ wx_login_info = THIRDLOGINCONF.wx_official def format_req_json(j_data, func, *args, **kwargs): - if j_data.get("errcode") == 40001 or 'invalid credential' in j_data.get('errmsg', ''): + if j_data.get("errcode", -1) in [40001] or 'invalid credential' in j_data.get('errmsg', ''): logger.error(f"error j_data {j_data}") status, result = sync_wx_access_token(True) if not status: @@ -32,7 +32,7 @@ def sync_wx_access_token(force=False): access_token_info = cache.get(wx_access_token_key) if not access_token_info or force: access_token_info = WxOfficialBase.make_wx_auth_obj().get_access_token() - if access_token_info.get('errcode') in ['40013'] or 'invalid appid' in access_token_info.get('errmsg'): + if access_token_info.get('errcode', -1) in [40013] or 'invalid appid' in access_token_info.get('errmsg', ''): return False, access_token_info expires_in = access_token_info.get('expires_in') if expires_in: