mirror of https://github.com/jumpserver/jumpserver
fix(authentication):修复开启二次认证时,地址跳转出错问题
parent
605db2d905
commit
3941539408
|
@ -26,7 +26,8 @@
|
|||
{% endif %}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="password" class="form-control" id="password" name="{{ form.password.html_name }}" placeholder="{% trans 'Password' %}" required="">
|
||||
<input type="password" class="form-control" id="password" placeholder="{% trans 'Password' %}" required="">
|
||||
<input id="password-hidden" type="text" style="display:none" name="{{ form.password.html_name }}">
|
||||
{% if form.errors.password %}
|
||||
<div class="help-block field-error">
|
||||
<p class="red-fonts">{{ form.errors.password.as_text }}</p>
|
||||
|
@ -82,27 +83,12 @@
|
|||
return jsencrypt.encrypt(password); //加密
|
||||
}
|
||||
function doLogin() {
|
||||
var rsaPublicKey = "{{ rsa_public_key }}";
|
||||
var password =$('#password').val();
|
||||
var passwordEncrypted = encryptLoginPassword(password, rsaPublicKey);
|
||||
var serialize_array = $('#form').serializeArray();
|
||||
$.each(serialize_array, function(index,obj){
|
||||
if(obj.name=='password'){
|
||||
obj.value=passwordEncrypted};
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '',
|
||||
data: serialize_array,
|
||||
success: function(data){
|
||||
$('body').html(data);
|
||||
},
|
||||
error: function(data){
|
||||
alert('服务器异常');
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
//公钥加密
|
||||
var rsaPublicKey = "{{ rsa_public_key }}"
|
||||
var password =$('#password').val(); //明文密码
|
||||
var passwordEncrypted = encryptLoginPassword(password, rsaPublicKey)
|
||||
$('#password-hidden').val(passwordEncrypted); //返回给密码输入input
|
||||
$('#form').submit();//post提交
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
|
|
@ -106,7 +106,8 @@
|
|||
{% endif %}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="password" class="form-control" id="password" name="{{ form.password.html_name }}" placeholder="{% trans 'Password' %}" required="">
|
||||
<input type="password" class="form-control" id="password" placeholder="{% trans 'Password' %}" required="">
|
||||
<input id="password-hidden" type="text" style="display:none" name="{{ form.password.html_name }}">
|
||||
{% if form.errors.password %}
|
||||
<div class="help-block field-error">
|
||||
<p class="red-fonts">{{ form.errors.password.as_text }}</p>
|
||||
|
@ -153,28 +154,13 @@
|
|||
return jsencrypt.encrypt(password); //加密
|
||||
}
|
||||
function doLogin() {
|
||||
var rsaPublicKey = "{{ rsa_public_key }}";
|
||||
var password =$('#password').val();
|
||||
var passwordEncrypted = encryptLoginPassword(password, rsaPublicKey);
|
||||
var serialize_array = $('#contact-form').serializeArray();
|
||||
$.each(serialize_array, function(index,obj){
|
||||
if(obj.name=='password'){
|
||||
obj.value=passwordEncrypted};
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '',
|
||||
data: serialize_array,
|
||||
success: function(data){
|
||||
$('body').html(data);
|
||||
},
|
||||
error: function(data){
|
||||
alert('服务器异常');
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
//公钥加密
|
||||
var rsaPublicKey = "{{ rsa_public_key }}"
|
||||
var password =$('#password').val(); //明文密码
|
||||
var passwordEncrypted = encryptLoginPassword(password, rsaPublicKey)
|
||||
$('#password-hidden').val(passwordEncrypted); //返回给密码输入input
|
||||
$('#contact-form').submit();//post提交
|
||||
}
|
||||
</script>
|
||||
</html>
|
||||
|
||||
|
|
Loading…
Reference in New Issue