fix se bug
Showing
2 changed files
with
12 additions
and
1 deletions
... | @@ -62,7 +62,13 @@ class ECM: | ... | @@ -62,7 +62,13 @@ class ECM: |
62 | self.oauth_token = token | 62 | self.oauth_token = token |
63 | self.token_type = response.json().get(self.token_type_key, self.token_type) | 63 | self.token_type = response.json().get(self.token_type_key, self.token_type) |
64 | expires = response.json().get(self.expires_key, 3600) | 64 | expires = response.json().get(self.expires_key, 3600) |
65 | rh.set_ecm_token(self.oauth_token, expires) | 65 | if isinstance(expires, int): |
66 | expires_int = expires - 10 | ||
67 | elif isinstance(expires, str): | ||
68 | expires_int = int(expires) - 10 | ||
69 | else: | ||
70 | expires_int = 3600 - 10 | ||
71 | rh.set_ecm_token(self.oauth_token, expires_int) | ||
66 | 72 | ||
67 | def get_oauth_token(self): | 73 | def get_oauth_token(self): |
68 | # if self.oauth_token is None: | 74 | # if self.oauth_token is None: | ... | ... |
... | @@ -2189,6 +2189,11 @@ def se_compare_license(license_en, ocr_res_dict, field_list): | ... | @@ -2189,6 +2189,11 @@ def se_compare_license(license_en, ocr_res_dict, field_list): |
2189 | # 过期期限特殊处理 | 2189 | # 过期期限特殊处理 |
2190 | if special_expiry_date and name == 'idExpiryDate' and result == consts.RESULT_N: | 2190 | if special_expiry_date and name == 'idExpiryDate' and result == consts.RESULT_N: |
2191 | if no_key: | 2191 | if no_key: |
2192 | if len(expiry_dates) == 0: | ||
2193 | ocr_str = empty_str | ||
2194 | result = consts.RESULT_N | ||
2195 | img_path = empty_str | ||
2196 | else: | ||
2192 | for expiry_date, (date_img_path, date_res_idx) in expiry_dates.items(): | 2197 | for expiry_date, (date_img_path, date_res_idx) in expiry_dates.items(): |
2193 | expiry_date_res = getattr(cp, compare_logic[name][1])(value, expiry_date, **compare_logic[name][2]) | 2198 | expiry_date_res = getattr(cp, compare_logic[name][1])(value, expiry_date, **compare_logic[name][2]) |
2194 | if expiry_date_res == consts.RESULT_N: | 2199 | if expiry_date_res == consts.RESULT_N: | ... | ... |
-
Please register or sign in to post a comment