Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
U
unify_api2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chaonan
unify_api2
Commits
eb25c449
Commit
eb25c449
authored
Apr 04, 2023
by
wang.wenrong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug_login_auth
parent
d3b3699e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
18 deletions
+31
-18
pot_libs
pot_libs
+1
-1
login_auth.py
unify_api/modules/common/procedures/login_auth.py
+30
-17
No files found.
pot_libs
@
a878a1f8
Subproject commit
05cfad9387871294a0215dabeccad37adbc487e3
Subproject commit
a878a1f82788f11deea04f8e64f668a83ed3a449
unify_api/modules/common/procedures/login_auth.py
View file @
eb25c449
...
@@ -42,7 +42,12 @@ async def get_test(request):
...
@@ -42,7 +42,12 @@ async def get_test(request):
def
is_need_verify
(
path
):
def
is_need_verify
(
path
):
# return False
if
SETTING
.
debug_mode
==
1
:
return
False
if
"swagger"
in
path
:
return
False
log
.
info
(
"is_or_not_need_verify path:
%
s"
,
path
)
log
.
info
(
"is_or_not_need_verify path:
%
s"
,
path
)
if
"swagger"
in
path
:
if
"swagger"
in
path
:
return
False
return
False
...
@@ -98,6 +103,8 @@ def is_need_verify(path):
...
@@ -98,6 +103,8 @@ def is_need_verify(path):
async
def
auth_verify
(
request
):
async
def
auth_verify
(
request
):
if
SETTING
.
debug_mode
==
1
:
return
False
path
=
request
.
path
path
=
request
.
path
if
is_need_verify
(
path
):
if
is_need_verify
(
path
):
token
=
request
.
token
token
=
request
.
token
...
@@ -136,6 +143,10 @@ async def auth_verify(request):
...
@@ -136,6 +143,10 @@ async def auth_verify(request):
def
is_need_auth_verify_cid
(
path
):
def
is_need_auth_verify_cid
(
path
):
if
SETTING
.
debug_mode
==
1
:
return
False
if
"swagger"
in
path
:
return
False
if
re
.
match
(
"^/unify-api/auth/"
,
path
):
if
re
.
match
(
"^/unify-api/auth/"
,
path
):
return
False
return
False
if
re
.
match
(
"^/api/common/wechat/mp"
,
path
):
if
re
.
match
(
"^/api/common/wechat/mp"
,
path
):
...
@@ -148,6 +159,8 @@ def is_need_auth_verify_cid(path):
...
@@ -148,6 +159,8 @@ def is_need_auth_verify_cid(path):
async
def
auth_verify_cid
(
request
):
async
def
auth_verify_cid
(
request
):
"""增加工厂权限校验"""
"""增加工厂权限校验"""
if
SETTING
.
debug_mode
==
1
:
return
False
path
=
request
.
path
path
=
request
.
path
# if not re.match("^/unify-api/auth/?$", path):
# if not re.match("^/unify-api/auth/?$", path):
if
is_need_auth_verify_cid
(
path
):
if
is_need_auth_verify_cid
(
path
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment