修改异常bug

dependabot/npm_and_yarn/fir_admin/tmpl-1.0.5
youngS 3 years ago
parent 31677fb1fd
commit ed05083bbe
  1. 4
      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): 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}") logger.error(f"error j_data {j_data}")
status, result = sync_wx_access_token(True) status, result = sync_wx_access_token(True)
if not status: if not status:
@ -32,7 +32,7 @@ def sync_wx_access_token(force=False):
access_token_info = cache.get(wx_access_token_key) access_token_info = cache.get(wx_access_token_key)
if not access_token_info or force: if not access_token_info or force:
access_token_info = WxOfficialBase.make_wx_auth_obj().get_access_token() 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 return False, access_token_info
expires_in = access_token_info.get('expires_in') expires_in = access_token_info.get('expires_in')
if expires_in: if expires_in:

Loading…
Cancel
Save