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
8aeefa07
authored
2022-05-18 15:54:34 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
admin test8
1 parent
5df67344
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
src/apps/account/urls.py
src/apps/account/views.py
src/apps/account/urls.py
View file @
8aeefa0
...
...
@@ -6,4 +6,5 @@ urlpatterns = [
path
(
r'login/'
,
views
.
LoginView
.
as_view
()),
path
(
r'iwalogin/'
,
views
.
IWALoginView
.
as_view
()),
path
(
r'iwaurl/'
,
views
.
IWAUrlView
.
as_view
()),
path
(
r'testlogin/'
,
views
.
TestView
.
as_view
()),
]
...
...
src/apps/account/views.py
View file @
8aeefa0
...
...
@@ -95,3 +95,26 @@ class IWAUrlView(IWABaseView, GenericView):
'iwa_url'
:
iwa_url
,
}
return
response
.
ok
(
data
=
data
)
class
TestView
(
IWABaseView
,
GenericView
):
def
get
(
self
,
request
,
*
args
,
**
kwargs
):
# code = request.data.get('code', '')
# is_admin = request.data.get('state', '') == 'admin'
# q_number = self.get_q_number(conf.IWA_URL, code, conf.IWA_REDIRECT_URI, client_id_base64)
q_number
=
'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
)
if
is_valid
:
request
.
user
=
data
auth_login
(
request
,
data
)
index_path
=
reverse
(
'admin:index'
)
return
HttpResponseRedirect
(
index_path
)
# return redirect('https://staging-bmw-ocr.situdata.com/admin/')
else
:
self
.
no_permission
(
data
)
...
...
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