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
4cfb40a9
authored
2022-05-13 10:44:08 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
add log
1 parent
cb704c3c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
src/apps/account/views.py
src/common/mixins.py
src/apps/account/views.py
View file @
4cfb40a
...
...
@@ -53,7 +53,9 @@ class IWALoginView(IWABaseView, GenericView):
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
code
=
request
.
data
.
get
(
'code'
,
''
)
# redirect_uri = request.data.get('redirect_uri', '')
q_number
=
self
.
get_q_number
(
conf
.
IWA_URL
,
code
,
conf
.
IWA_REDIRECT_URI
,
client_id_base64
)
iwa_res
=
self
.
get_q_number
(
conf
.
IWA_URL
,
code
,
conf
.
IWA_REDIRECT_URI
,
client_id_base64
)
q_number
=
iwa_res
.
get
(
'sub'
,
''
)
self
.
running_log
.
info
(
'iwa_res: {0}'
.
format
(
iwa_res
))
is_valid
,
data
=
self
.
validate
(
q_number
)
...
...
src/common/mixins.py
View file @
4cfb40a
...
...
@@ -135,7 +135,7 @@ class IWABaseView:
iwa_user_url
=
'{0}userinfo'
.
format
(
iwa_url_base
)
res
=
requests
.
get
(
iwa_user_url
,
headers
=
headers
)
return
res
.
json
()
.
get
(
'sub'
,
''
)
return
res
.
json
()
@staticmethod
def
validate
(
q_number
):
...
...
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