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
7197f405
authored
2022-05-18 16:25:12 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
admin admin login
1 parent
96310924
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
8 deletions
src/apps/account/views.py
src/apps/myadmin/admin.py
src/apps/account/views.py
View file @
7197f40
...
...
@@ -98,12 +98,10 @@ class AdminLoginView(IWABaseView, GenericView):
def
get
(
self
,
request
,
*
args
,
**
kwargs
):
code
=
request
.
GET
.
get
(
'code'
,
''
)
is_admin
=
request
.
GET
.
get
(
'state'
,
''
)
==
'admin'
# q_number = self.get_q_number(conf.IWA_URL, code, conf.IWA_REDIRECT_URI, client_id_base64)
self
.
running_log
.
info
(
'code={0}, is_admin={1}'
.
format
(
code
,
is_admin
))
q_number
=
'admin'
# is_admin = request.GET.get('state', '') == 'admin'
q_number
=
self
.
get_q_number
(
conf
.
IWA_URL
,
code
,
conf
.
IWA_REDIRECT_URI
,
client_id_base64
)
# self.running_log.info('code={0}, is_admin={1}'.format(code, is_admin))
self
.
running_log
.
info
(
'[admin_users.iwalogin] [username: {0}] [params: {1}]'
.
format
(
q_number
,
request
.
data
))
is_valid
,
data
=
self
.
validate_admin
(
q_number
)
...
...
src/apps/myadmin/admin.py
View file @
7197f40
...
...
@@ -8,7 +8,7 @@ from settings import conf
iwa_admin_url_params
=
{
'scope'
:
'openid'
,
'response_type'
:
'code'
,
'redirect_uri'
:
conf
.
IWA_REDIRECT_URI
,
'redirect_uri'
:
conf
.
IWA_
ADMIN_
REDIRECT_URI
,
'client_id'
:
conf
.
IWA_CLIENT_ID
,
'acr_values'
:
'strongAuth4000Service'
}
...
...
@@ -26,8 +26,8 @@ class MyAdminSite(admin.AdminSite):
# Already logged-in, redirect to admin index
index_path
=
reverse
(
'admin:index'
,
current_app
=
self
.
name
)
return
HttpResponseRedirect
(
index_path
)
#
return HttpResponseRedirect(iwa_admin_url)
return
HttpResponseRedirect
(
'https://staging-bmw-ocr.situdata.com/api/user/adminlogin/?state=admin&code=xxx'
)
return
HttpResponseRedirect
(
iwa_admin_url
)
#
return HttpResponseRedirect('https://staging-bmw-ocr.situdata.com/api/user/adminlogin/?state=admin&code=xxx')
admin_site
=
MyAdminSite
()
...
...
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