417d8dee by 周伟奇

token fix

1 parent 2e2c0a83
......@@ -487,7 +487,6 @@ class Command(BaseCommand, LoggerMixin):
else:
self.folder_log.warn('{0} [go failed] [img_path={1}]'.format(self.log_base, img_path))
def get_pno(self, img_path):
img_name, _ = os.path.splitext(os.path.basename(img_path))
return int(img_name.split('_')[1])
......
......@@ -31,7 +31,13 @@ class CMS:
self.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_cms_token(self.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_cms_token(self.token, expires_int)
def get_token(self):
# if self.token is None:
......
......@@ -1390,10 +1390,10 @@ class AutoSettlementView(GenericView):
class AutoSettlementExcelView(GenericView):
# permission_classes = []
# authentication_classes = []
permission_classes = [IsAuthenticated]
authentication_classes = [OAuth2AuthenticationWithUser]
permission_classes = []
authentication_classes = []
# permission_classes = [IsAuthenticated]
# authentication_classes = [OAuth2AuthenticationWithUser]
# 获取auto settlement excel
@use_args(auto_list_args, location='querystring')
......
......@@ -12,7 +12,7 @@ EDMS_DOWNLOAD_URL = http://sccn0639.bmwgroup.net/FH/FileHold/DocumentRepository/
EDMS_UPLOAD_URL = http://sccn0639.bmwgroup.net/FH/FileHold/DocumentRepository/UploadHandler.ashx
DEALER_CODE = ocr_group
BASE_URL = https://lp19dkocrprod01vm.bmwgroup.net
BASE_URL = https://sfocr-prod.bmwgroup.net
DELAY_SECONDS = 60
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!