token fix
Showing
4 changed files
with
12 additions
and
7 deletions
... | @@ -487,7 +487,6 @@ class Command(BaseCommand, LoggerMixin): | ... | @@ -487,7 +487,6 @@ class Command(BaseCommand, LoggerMixin): |
487 | else: | 487 | else: |
488 | self.folder_log.warn('{0} [go failed] [img_path={1}]'.format(self.log_base, img_path)) | 488 | self.folder_log.warn('{0} [go failed] [img_path={1}]'.format(self.log_base, img_path)) |
489 | 489 | ||
490 | |||
491 | def get_pno(self, img_path): | 490 | def get_pno(self, img_path): |
492 | img_name, _ = os.path.splitext(os.path.basename(img_path)) | 491 | img_name, _ = os.path.splitext(os.path.basename(img_path)) |
493 | return int(img_name.split('_')[1]) | 492 | return int(img_name.split('_')[1]) | ... | ... |
... | @@ -31,7 +31,13 @@ class CMS: | ... | @@ -31,7 +31,13 @@ class CMS: |
31 | self.token = token | 31 | self.token = token |
32 | self.token_type = response.json().get(self.token_type_key, self.token_type) | 32 | self.token_type = response.json().get(self.token_type_key, self.token_type) |
33 | expires = response.json().get(self.expires_key, 3600) | 33 | expires = response.json().get(self.expires_key, 3600) |
34 | rh.set_cms_token(self.token, expires) | 34 | if isinstance(expires, int): |
35 | expires_int = expires - 10 | ||
36 | elif isinstance(expires, str): | ||
37 | expires_int = int(expires) - 10 | ||
38 | else: | ||
39 | expires_int = 3600 - 10 | ||
40 | rh.set_cms_token(self.token, expires_int) | ||
35 | 41 | ||
36 | def get_token(self): | 42 | def get_token(self): |
37 | # if self.token is None: | 43 | # if self.token is None: | ... | ... |
... | @@ -1390,10 +1390,10 @@ class AutoSettlementView(GenericView): | ... | @@ -1390,10 +1390,10 @@ class AutoSettlementView(GenericView): |
1390 | 1390 | ||
1391 | 1391 | ||
1392 | class AutoSettlementExcelView(GenericView): | 1392 | class AutoSettlementExcelView(GenericView): |
1393 | # permission_classes = [] | 1393 | permission_classes = [] |
1394 | # authentication_classes = [] | 1394 | authentication_classes = [] |
1395 | permission_classes = [IsAuthenticated] | 1395 | # permission_classes = [IsAuthenticated] |
1396 | authentication_classes = [OAuth2AuthenticationWithUser] | 1396 | # authentication_classes = [OAuth2AuthenticationWithUser] |
1397 | 1397 | ||
1398 | # 获取auto settlement excel | 1398 | # 获取auto settlement excel |
1399 | @use_args(auto_list_args, location='querystring') | 1399 | @use_args(auto_list_args, location='querystring') | ... | ... |
... | @@ -12,7 +12,7 @@ EDMS_DOWNLOAD_URL = http://sccn0639.bmwgroup.net/FH/FileHold/DocumentRepository/ | ... | @@ -12,7 +12,7 @@ EDMS_DOWNLOAD_URL = http://sccn0639.bmwgroup.net/FH/FileHold/DocumentRepository/ |
12 | EDMS_UPLOAD_URL = http://sccn0639.bmwgroup.net/FH/FileHold/DocumentRepository/UploadHandler.ashx | 12 | EDMS_UPLOAD_URL = http://sccn0639.bmwgroup.net/FH/FileHold/DocumentRepository/UploadHandler.ashx |
13 | DEALER_CODE = ocr_group | 13 | DEALER_CODE = ocr_group |
14 | 14 | ||
15 | BASE_URL = https://lp19dkocrprod01vm.bmwgroup.net | 15 | BASE_URL = https://sfocr-prod.bmwgroup.net |
16 | 16 | ||
17 | DELAY_SECONDS = 60 | 17 | DELAY_SECONDS = 60 |
18 | 18 | ... | ... |
-
Please register or sign in to post a comment