Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
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
ops
jumpserver
Commits
74f22274
Commit
74f22274
authored
Nov 11, 2019
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 修改登录验证
parent
9e487483
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
8 deletions
+9
-8
login_wait_confirm.html
...tication/templates/authentication/login_wait_confirm.html
+4
-6
xpack_login.html
.../authentication/templates/authentication/xpack_login.html
+2
-0
login.py
apps/authentication/views/login.py
+3
-2
No files found.
apps/authentication/templates/authentication/login_wait_confirm.html
View file @
74f22274
...
...
@@ -81,7 +81,9 @@ function doRequestAuth() {
url
:
url
,
method
:
"GET"
,
success
:
function
(
data
)
{
if
(
data
.
error
!==
"login_confirm_wait"
)
{
if
(
!
data
.
error
&&
data
.
msg
===
'ok'
)
{
window
.
location
=
"{% url 'authentication:login-guard' %}"
}
else
if
(
data
.
error
!==
"login_confirm_wait"
)
{
if
(
!
errorMsgShow
)
{
infoMsgRef
.
hide
();
errorMsgRef
.
show
();
...
...
@@ -90,11 +92,7 @@ function doRequestAuth() {
}
clearInterval
(
interval
);
clearInterval
(
checkInterval
);
$
(
".copy-btn"
).
attr
(
'disabled'
,
'disabled'
)
}
if
(
data
.
msg
===
'ok'
&&
!
data
.
error
)
{
window
.
location
=
"{% url 'authentication:login-guard' %}"
}
else
{
$
(
".copy-btn"
).
attr
(
'disabled'
,
'disabled'
);
errorMsgRef
.
html
(
data
.
msg
)
}
},
...
...
apps/authentication/templates/authentication/xpack_login.html
View file @
74f22274
...
...
@@ -85,6 +85,8 @@
</div>
{% elif form.errors.captcha %}
<p
class=
"red-fonts"
>
{% trans 'Captcha invalid' %}
</p>
{% else %}
<div
style=
"height: 50px"
></div>
{% endif %}
<div
class=
"form-group"
>
...
...
apps/authentication/views/login.py
View file @
74f22274
...
...
@@ -22,7 +22,6 @@ from common.utils import get_request_ip, get_object_or_none
from
users.utils
import
(
redirect_user_first_login_or_index
)
from
..signals
import
post_auth_success
,
post_auth_failed
from
..
import
forms
,
mixins
,
errors
...
...
@@ -75,7 +74,9 @@ class UserLoginView(mixins.AuthMixin, FormView):
form
.
add_error
(
None
,
e
.
msg
)
ip
=
self
.
get_request_ip
()
cache
.
set
(
self
.
key_prefix_captcha
.
format
(
ip
),
1
,
3600
)
context
=
self
.
get_context_data
(
form
=
form
)
new_form
=
self
.
form_class_captcha
(
data
=
form
.
data
)
new_form
.
_errors
=
form
.
errors
context
=
self
.
get_context_data
(
form
=
new_form
)
return
self
.
render_to_response
(
context
)
return
self
.
redirect_to_guard_view
()
...
...
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