f75cb473 by 周伟奇

fix se bug

1 parent bb00ae7a
......@@ -62,7 +62,13 @@ class ECM:
self.oauth_token = token
self.token_type = response.json().get(self.token_type_key, self.token_type)
expires = response.json().get(self.expires_key, 3600)
rh.set_ecm_token(self.oauth_token, expires)
if isinstance(expires, int):
expires_int = expires - 10
elif isinstance(expires, str):
expires_int = int(expires) - 10
else:
expires_int = 3600 - 10
rh.set_ecm_token(self.oauth_token, expires_int)
def get_oauth_token(self):
# if self.oauth_token is None:
......
......@@ -2189,6 +2189,11 @@ def se_compare_license(license_en, ocr_res_dict, field_list):
# 过期期限特殊处理
if special_expiry_date and name == 'idExpiryDate' and result == consts.RESULT_N:
if no_key:
if len(expiry_dates) == 0:
ocr_str = empty_str
result = consts.RESULT_N
img_path = empty_str
else:
for expiry_date, (date_img_path, date_res_idx) in expiry_dates.items():
expiry_date_res = getattr(cp, compare_logic[name][1])(value, expiry_date, **compare_logic[name][2])
if expiry_date_res == consts.RESULT_N:
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!