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
e1ef7848
authored
2025-07-09 17:35:23 +0800
by
冯轩
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
去掉发票接口权限校验
1 parent
ff96bf21
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
src/apps/doc/views.py
src/apps/doc/views.py
View file @
e1ef784
...
...
@@ -1997,12 +1997,12 @@ class InvoiceExcelView(GenericView):
application_entity
=
args
.
get
(
'application_entity'
)
self
.
running_log
.
info
(
'[InvoiceExcelView] [user_role={0}] '
.
format
(
'111222333'
))
# 角色权限不符,返回异常
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
is
None
or
user_role
==
'-1'
or
(
user_role
==
'1'
and
application_entity
==
'2'
)
or
(
user_role
==
'2'
and
application_entity
==
'1'
):
self
.
running_log
.
info
(
'[InvoiceExcelView no permission] [user_role={0}] [application_entity={1}]'
.
format
(
user_role
,
application_entity
))
raise
NoPermissionException
(
'no permission'
)
#
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 is None or user_role == '-1' or (user_role == '1' and application_entity == '2') or (user_role == '2' and application_entity == '1'):
#
self.running_log.info('[InvoiceExcelView no permission] [user_role={0}] [application_entity={1}]'.format(user_role, application_entity))
#
raise NoPermissionException('no permission')
url
=
'http://127.0.0.1:8088/napi/invoice/downloadExcelOri'
body
=
{
...
...
@@ -2043,12 +2043,12 @@ class InvoiceQueryInfoView(GenericView):
self
.
running_log
.
info
(
'[InvoiceExcelView] [user_role={0}] '
.
format
(
'111222333'
))
# 角色权限不符,返回异常
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
is
None
or
user_role
==
'-1'
or
(
user_role
==
'1'
and
application_entity
==
'2'
)
or
(
user_role
==
'2'
and
application_entity
==
'1'
):
self
.
running_log
.
info
(
'[InvoiceExcelView no permission] [user_role={0}] [application_entity={1}]'
.
format
(
user_role
,
application_entity
))
raise
NoPermissionException
(
'no permission'
)
#
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 is None or user_role == '-1' or (user_role == '1' and application_entity == '2') or (user_role == '2' and application_entity == '1'):
#
self.running_log.info('[InvoiceExcelView no permission] [user_role={0}] [application_entity={1}]'.format(user_role, application_entity))
#
raise NoPermissionException('no permission')
url
=
'http://127.0.0.1:8088/napi/invoice/queryInfoOri'
body
=
{
...
...
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