user role 使用字符串
Showing
2 changed files
with
7 additions
and
7 deletions
src-20240521-5.zip
deleted
100644 → 0
No preview for this file type
... | @@ -1069,8 +1069,8 @@ class DocView(DocGenericView, DocHandler): | ... | @@ -1069,8 +1069,8 @@ class DocView(DocGenericView, DocHandler): |
1069 | # 角色权限不符,返回空列表 | 1069 | # 角色权限不符,返回空列表 |
1070 | token = request.META.get("HTTP_AUTHORIZATION") | 1070 | token = request.META.get("HTTP_AUTHORIZATION") |
1071 | user_role = rh.get_token(token[-11:]) | 1071 | user_role = rh.get_token(token[-11:]) |
1072 | self.running_log.info('[api doc] [user_role={0}] '.format(user_role)) | 1072 | self.running_log.info('[api doc] [user_role={0} business_type={1}] '.format(user_role, business_type)) |
1073 | if user_role == -1 or (user_role == 1 and business_type == 'HIL') or (user_role == 2 and business_type == 'AFC'): | 1073 | if user_role == '-1' or (user_role == '1' and business_type == 'HIL') or (user_role == '2' and business_type == 'AFC'): |
1074 | pagination = {'current': page, 'total': 0, 'page_size': page_size} | 1074 | pagination = {'current': page, 'total': 0, 'page_size': page_size} |
1075 | res = { | 1075 | res = { |
1076 | 'pagination': pagination, | 1076 | 'pagination': pagination, |
... | @@ -1248,7 +1248,7 @@ class CompareResultView(GenericView): | ... | @@ -1248,7 +1248,7 @@ class CompareResultView(GenericView): |
1248 | token = request.META.get("HTTP_AUTHORIZATION") | 1248 | token = request.META.get("HTTP_AUTHORIZATION") |
1249 | user_role = rh.get_token(token[-11:]) | 1249 | user_role = rh.get_token(token[-11:]) |
1250 | self.running_log.info('[api doc] [user_role={0}] '.format(user_role)) | 1250 | self.running_log.info('[api doc] [user_role={0}] '.format(user_role)) |
1251 | if user_role == -1 or (user_role == 1 and entity == 'HIL') or (user_role == 2 and entity == 'AFC'): | 1251 | if user_role == '-1' or (user_role == '1' and entity == 'HIL') or (user_role == '2' and entity == 'AFC'): |
1252 | raise NoPermissionException('no permission') | 1252 | raise NoPermissionException('no permission') |
1253 | 1253 | ||
1254 | if is_auto == 1: | 1254 | if is_auto == 1: |
... | @@ -1645,7 +1645,7 @@ class AutoSettlementView(GenericView): | ... | @@ -1645,7 +1645,7 @@ class AutoSettlementView(GenericView): |
1645 | token = request.META.get("HTTP_AUTHORIZATION") | 1645 | token = request.META.get("HTTP_AUTHORIZATION") |
1646 | user_role = rh.get_token(token[-11:]) | 1646 | user_role = rh.get_token(token[-11:]) |
1647 | self.running_log.info('[api doc] [user_role={0}] '.format(user_role)) | 1647 | self.running_log.info('[api doc] [user_role={0}] '.format(user_role)) |
1648 | if user_role == -1 or (user_role == 1 and business_type == 'HIL') or (user_role == 2 and business_type == 'AFC'): | 1648 | if user_role == '-1' or (user_role == '1' and business_type == 'HIL') or (user_role == '2' and business_type == 'AFC'): |
1649 | pagination = {'current': page, 'total': 0, 'page_size': page_size} | 1649 | pagination = {'current': page, 'total': 0, 'page_size': page_size} |
1650 | res = { | 1650 | res = { |
1651 | 'pagination': pagination, | 1651 | 'pagination': pagination, |
... | @@ -1741,7 +1741,7 @@ class AutoSettlementExcelView(GenericView): | ... | @@ -1741,7 +1741,7 @@ class AutoSettlementExcelView(GenericView): |
1741 | token = request.META.get("HTTP_AUTHORIZATION") | 1741 | token = request.META.get("HTTP_AUTHORIZATION") |
1742 | user_role = rh.get_token(token[-11:]) | 1742 | user_role = rh.get_token(token[-11:]) |
1743 | self.running_log.info('[api doc] [user_role={0}] '.format(user_role)) | 1743 | self.running_log.info('[api doc] [user_role={0}] '.format(user_role)) |
1744 | if user_role == -1 or (user_role == 1 and business_type == 'HIL') or (user_role == 2 and business_type == 'AFC'): | 1744 | if user_role == '-1' or (user_role == '1' and business_type == 'HIL') or (user_role == '2' and business_type == 'AFC'): |
1745 | raise NoPermissionException('no permission') | 1745 | raise NoPermissionException('no permission') |
1746 | 1746 | ||
1747 | if isinstance(auto_result, int): | 1747 | if isinstance(auto_result, int): |
... | @@ -1906,7 +1906,7 @@ class InvoiceExcelView(GenericView): | ... | @@ -1906,7 +1906,7 @@ class InvoiceExcelView(GenericView): |
1906 | token = request.META.get("HTTP_AUTHORIZATION") | 1906 | token = request.META.get("HTTP_AUTHORIZATION") |
1907 | user_role = rh.get_token(token[-11:]) | 1907 | user_role = rh.get_token(token[-11:]) |
1908 | self.running_log.info('[InvoiceExcelView] [user_role={0}] '.format(user_role)) | 1908 | self.running_log.info('[InvoiceExcelView] [user_role={0}] '.format(user_role)) |
1909 | if user_role == -1 or (user_role == 1 and application_entity == 'HIL') or (user_role == 2 and application_entity == 'AFC'): | 1909 | if user_role == '-1' or (user_role == '1' and application_entity == 'HIL') or (user_role == '2' and application_entity == 'AFC'): |
1910 | raise NoPermissionException('no permission') | 1910 | raise NoPermissionException('no permission') |
1911 | 1911 | ||
1912 | url = 'http://127.0.0.1:8088/napi/invoice/downloadExcelOri' | 1912 | url = 'http://127.0.0.1:8088/napi/invoice/downloadExcelOri' |
... | @@ -1950,7 +1950,7 @@ class InvoiceQueryInfoView(GenericView): | ... | @@ -1950,7 +1950,7 @@ class InvoiceQueryInfoView(GenericView): |
1950 | token = request.META.get("HTTP_AUTHORIZATION") | 1950 | token = request.META.get("HTTP_AUTHORIZATION") |
1951 | user_role = rh.get_token(token[-11:]) | 1951 | user_role = rh.get_token(token[-11:]) |
1952 | self.running_log.info('[InvoiceQueryInfoView] [user_role={0}] '.format(user_role)) | 1952 | self.running_log.info('[InvoiceQueryInfoView] [user_role={0}] '.format(user_role)) |
1953 | if user_role == -1 or (user_role == 1 and application_entity == 'HIL') or (user_role == 2 and application_entity == 'AFC'): | 1953 | if user_role == '-1' or (user_role == '1' and application_entity == 'HIL') or (user_role == '2' and application_entity == 'AFC'): |
1954 | raise NoPermissionException('no permission') | 1954 | raise NoPermissionException('no permission') |
1955 | 1955 | ||
1956 | url = 'http://127.0.0.1:8088/napi/invoice/queryInfoOri' | 1956 | url = 'http://127.0.0.1:8088/napi/invoice/queryInfoOri' | ... | ... |
-
Please register or sign in to post a comment