|
|
|
@ -41,6 +41,7 @@ $(document).ready(function () {
|
|
|
|
|
// 密码强度校验
|
|
|
|
|
var el = $('#id_password_rules'),
|
|
|
|
|
idPassword = $('#id_new_password'),
|
|
|
|
|
idConfirmPassword = $('#id_confirm_password'),
|
|
|
|
|
idPopover = $('#popover777'),
|
|
|
|
|
container = $('#container'),
|
|
|
|
|
progress = $('#id_progress'),
|
|
|
|
@ -82,15 +83,21 @@ $(document).ready(function () {
|
|
|
|
|
$("form").submit(function(event){
|
|
|
|
|
event.preventDefault()
|
|
|
|
|
// Let's find the input to check
|
|
|
|
|
var ids = ['id_new_password', 'id_confirm_password']
|
|
|
|
|
for (id of ids) {
|
|
|
|
|
var passwordRef = $('#' + id)
|
|
|
|
|
var value = passwordRef.val()
|
|
|
|
|
if (value) {
|
|
|
|
|
value = encryptPassword(value)
|
|
|
|
|
passwordRef.val(value)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
var encryptedPassword = encryptPassword(idPassword.val());
|
|
|
|
|
var encryptedConfirmPassword = encryptPassword(idConfirmPassword.val());
|
|
|
|
|
|
|
|
|
|
var hiddenPasswordField = $('<input>', {
|
|
|
|
|
type: 'hidden',
|
|
|
|
|
name: 'new_password',
|
|
|
|
|
value: encryptedPassword
|
|
|
|
|
});
|
|
|
|
|
var hiddenConfirmPasswordField = $('<input>', {
|
|
|
|
|
type: 'hidden',
|
|
|
|
|
name: 'confirm_password',
|
|
|
|
|
value: encryptedConfirmPassword
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$(this).append(hiddenPasswordField, hiddenConfirmPasswordField);
|
|
|
|
|
this.submit();
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|