...
|
...
|
@@ -2,7 +2,7 @@ |
|
|
* @Author: Targaryen
|
|
|
* @Date: 2017-04-13 14:43:19
|
|
|
* @Last Modified by: Targaryen
|
|
|
* @Last Modified time: 2017-04-14 17:53:47
|
|
|
* @Last Modified time: 2017-04-18 11:36:23
|
|
|
*/
|
|
|
|
|
|
/* ***************
|
...
|
...
|
@@ -21,7 +21,23 @@ let $oldPasswordInput = $('#oldPassword'); |
|
|
let $newPasswordInput = $('#newPassword');
|
|
|
let $eye = $resetForm.find('.eye');
|
|
|
let $sureResetBtn = $('#sureResetBtn');
|
|
|
let $ignoreBtn = $('#ignoreBtn');
|
|
|
|
|
|
|
|
|
// 登录按钮状态切换
|
|
|
function switchLoginBtnStatus() {
|
|
|
let active = ($oldPasswordInput.val() && $newPasswordInput.val()) ? true : false;
|
|
|
|
|
|
$sureResetBtn.toggleClass('active', active);
|
|
|
}
|
|
|
|
|
|
|
|
|
$oldPasswordInput.bind('input', function() {
|
|
|
switchLoginBtnStatus();
|
|
|
});
|
|
|
|
|
|
$newPasswordInput.bind('input', function() {
|
|
|
switchLoginBtnStatus();
|
|
|
});
|
|
|
|
|
|
/**
|
|
|
* 密码显示隐藏
|
...
|
...
|
@@ -40,6 +56,10 @@ $eye.on('click', function() { |
|
|
* 提交密码重置
|
|
|
*/
|
|
|
$sureResetBtn.on('click', function() {
|
|
|
if (!$sureResetBtn.hasClass('active')) {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
// 简单的密码校验
|
|
|
if (!$oldPasswordInput.val() || !$newPasswordInput.val()) {
|
|
|
tip.show('请输入旧密码和新密码');
|
...
|
...
|
@@ -62,21 +82,18 @@ $sureResetBtn.on('click', function() { |
|
|
success: function(result) {
|
|
|
tip.show(result.message);
|
|
|
|
|
|
if (result.code === 200) {
|
|
|
setTimeout(function() {
|
|
|
window.location.href = '/passport/login';
|
|
|
}, 500);
|
|
|
let href = '/passport/password/resetsuccess';
|
|
|
|
|
|
if (result.code !== 200) {
|
|
|
href = '/passport/login';
|
|
|
}
|
|
|
|
|
|
setTimeout(function() {
|
|
|
window.location.href = href;
|
|
|
}, 500);
|
|
|
},
|
|
|
error: function() {
|
|
|
tip.show('系统异常!');
|
|
|
}
|
|
|
});
|
|
|
}); |
|
|
|
|
|
/**
|
|
|
* 跳过弱密码校验
|
|
|
*/
|
|
|
$ignoreBtn.on('click', function() {
|
|
|
location.href = '/passport/login?isskip=Y';
|
|
|
}); |
...
|
...
|
|