Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
周伟奇
/
bmw-ocr
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
428070e2
authored
2024-05-27 16:08:37 +0800
by
冯轩
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
user role 使用字符串
1 parent
840e3367
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
src-20240521-5.zip
src/apps/doc/views.py
src-20240521-5.zip
deleted
100644 → 0
View file @
840e336
No preview for this file type
src/apps/doc/views.py
View file @
428070e
...
...
@@ -1069,8 +1069,8 @@ class DocView(DocGenericView, DocHandler):
# 角色权限不符,返回空列表
token
=
request
.
META
.
get
(
"HTTP_AUTHORIZATION"
)
user_role
=
rh
.
get_token
(
token
[
-
11
:])
self
.
running_log
.
info
(
'[api doc] [user_role={0}
] '
.
format
(
user_rol
e
))
if
user_role
==
-
1
or
(
user_role
==
1
and
business_type
==
'HIL'
)
or
(
user_role
==
2
and
business_type
==
'AFC'
):
self
.
running_log
.
info
(
'[api doc] [user_role={0}
business_type={1}] '
.
format
(
user_role
,
business_typ
e
))
if
user_role
==
'-1'
or
(
user_role
==
'1'
and
business_type
==
'HIL'
)
or
(
user_role
==
'2'
and
business_type
==
'AFC'
):
pagination
=
{
'current'
:
page
,
'total'
:
0
,
'page_size'
:
page_size
}
res
=
{
'pagination'
:
pagination
,
...
...
@@ -1248,7 +1248,7 @@ class CompareResultView(GenericView):
token
=
request
.
META
.
get
(
"HTTP_AUTHORIZATION"
)
user_role
=
rh
.
get_token
(
token
[
-
11
:])
self
.
running_log
.
info
(
'[api doc] [user_role={0}] '
.
format
(
user_role
))
if
user_role
==
-
1
or
(
user_role
==
1
and
entity
==
'HIL'
)
or
(
user_role
==
2
and
entity
==
'AFC'
):
if
user_role
==
'-1'
or
(
user_role
==
'1'
and
entity
==
'HIL'
)
or
(
user_role
==
'2'
and
entity
==
'AFC'
):
raise
NoPermissionException
(
'no permission'
)
if
is_auto
==
1
:
...
...
@@ -1645,7 +1645,7 @@ class AutoSettlementView(GenericView):
token
=
request
.
META
.
get
(
"HTTP_AUTHORIZATION"
)
user_role
=
rh
.
get_token
(
token
[
-
11
:])
self
.
running_log
.
info
(
'[api doc] [user_role={0}] '
.
format
(
user_role
))
if
user_role
==
-
1
or
(
user_role
==
1
and
business_type
==
'HIL'
)
or
(
user_role
==
2
and
business_type
==
'AFC'
):
if
user_role
==
'-1'
or
(
user_role
==
'1'
and
business_type
==
'HIL'
)
or
(
user_role
==
'2'
and
business_type
==
'AFC'
):
pagination
=
{
'current'
:
page
,
'total'
:
0
,
'page_size'
:
page_size
}
res
=
{
'pagination'
:
pagination
,
...
...
@@ -1741,7 +1741,7 @@ class AutoSettlementExcelView(GenericView):
token
=
request
.
META
.
get
(
"HTTP_AUTHORIZATION"
)
user_role
=
rh
.
get_token
(
token
[
-
11
:])
self
.
running_log
.
info
(
'[api doc] [user_role={0}] '
.
format
(
user_role
))
if
user_role
==
-
1
or
(
user_role
==
1
and
business_type
==
'HIL'
)
or
(
user_role
==
2
and
business_type
==
'AFC'
):
if
user_role
==
'-1'
or
(
user_role
==
'1'
and
business_type
==
'HIL'
)
or
(
user_role
==
'2'
and
business_type
==
'AFC'
):
raise
NoPermissionException
(
'no permission'
)
if
isinstance
(
auto_result
,
int
):
...
...
@@ -1906,7 +1906,7 @@ class InvoiceExcelView(GenericView):
token
=
request
.
META
.
get
(
"HTTP_AUTHORIZATION"
)
user_role
=
rh
.
get_token
(
token
[
-
11
:])
self
.
running_log
.
info
(
'[InvoiceExcelView] [user_role={0}] '
.
format
(
user_role
))
if
user_role
==
-
1
or
(
user_role
==
1
and
application_entity
==
'HIL'
)
or
(
user_role
==
2
and
application_entity
==
'AFC'
):
if
user_role
==
'-1'
or
(
user_role
==
'1'
and
application_entity
==
'HIL'
)
or
(
user_role
==
'2'
and
application_entity
==
'AFC'
):
raise
NoPermissionException
(
'no permission'
)
url
=
'http://127.0.0.1:8088/napi/invoice/downloadExcelOri'
...
...
@@ -1950,7 +1950,7 @@ class InvoiceQueryInfoView(GenericView):
token
=
request
.
META
.
get
(
"HTTP_AUTHORIZATION"
)
user_role
=
rh
.
get_token
(
token
[
-
11
:])
self
.
running_log
.
info
(
'[InvoiceQueryInfoView] [user_role={0}] '
.
format
(
user_role
))
if
user_role
==
-
1
or
(
user_role
==
1
and
application_entity
==
'HIL'
)
or
(
user_role
==
2
and
application_entity
==
'AFC'
):
if
user_role
==
'-1'
or
(
user_role
==
'1'
and
application_entity
==
'HIL'
)
or
(
user_role
==
'2'
and
application_entity
==
'AFC'
):
raise
NoPermissionException
(
'no permission'
)
url
=
'http://127.0.0.1:8088/napi/invoice/queryInfoOri'
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment