...
|
...
|
@@ -12,6 +12,7 @@ var $pwd = $('#pwd'), |
|
|
$pwdErr = $('#pwd-err'),
|
|
|
$repwdErr = $('#repwd-err'),
|
|
|
$titleTip = $('.title-tip'),
|
|
|
$waakRepwdTip = $('.waak-repwd-tip'),
|
|
|
$weakPwdPass = $('.weak-pwd-pass');
|
|
|
|
|
|
var pwdRegx = require('../common/mail-phone-regx').pwdValidateRegx;
|
...
|
...
|
@@ -25,7 +26,7 @@ $('input').placeholder(); |
|
|
$('.va').keyup(function() {
|
|
|
var pass = true;
|
|
|
|
|
|
if ($(this).val() === '') {
|
|
|
if ($pwd.val() === '' || $repwd.val() === '') {
|
|
|
pass = false;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -51,9 +52,6 @@ $('.va').keyup(function() { |
|
|
if (v === '') {
|
|
|
$this.addClass('error');
|
|
|
$pwdErr.removeClass('hide').find('em').text('请输入密码');
|
|
|
} else if (v.length < 6 || v.length > 20) {
|
|
|
$this.addClass('error');
|
|
|
$pwdErr.removeClass('hide').find('em').text('密码只支持6-20位');
|
|
|
}
|
|
|
} else {
|
|
|
if (v === '') {
|
...
|
...
|
@@ -66,6 +64,8 @@ $('.va').keyup(function() { |
|
|
$this.addClass('error');
|
|
|
$repwdErr.removeClass('hide').find('em').text('密码须字母和数字组合');
|
|
|
}
|
|
|
|
|
|
$waakRepwdTip.find('span').addClass('hide');
|
|
|
}
|
|
|
|
|
|
$(this).trigger('keyup');
|
...
|
...
|
@@ -77,6 +77,7 @@ $('.va').keyup(function() { |
|
|
$pwdErr.addClass('hide');
|
|
|
} else {
|
|
|
$repwdErr.addClass('hide');
|
|
|
$waakRepwdTip.find('span').removeClass('hide');
|
|
|
}
|
|
|
});
|
|
|
|
...
|
...
|
@@ -92,17 +93,31 @@ $('#pwd, #repwd').keydown(function(e) { |
|
|
|
|
|
$next.on('click', function() {
|
|
|
var refer = $weakPwdPass.data('href') || '/';
|
|
|
var $this = $(this);
|
|
|
|
|
|
// is frequent click
|
|
|
if ($this.data('is-execu')) {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
$this.data('is-execu', true);
|
|
|
|
|
|
$.post('/passport/back/modPwdByCodeAPI', {
|
|
|
oldPwd: $pwd.val(),
|
|
|
newPwd: $repwd.val()
|
|
|
}, function(d) {
|
|
|
$this.data('is-execu', false);
|
|
|
|
|
|
if (d.code === 200) {
|
|
|
document.location.href = '//www.yohobuy.com/passport/back/weakSuccess?refer=' + refer;
|
|
|
return true;
|
|
|
} else if (d.code === 402) {
|
|
|
// token is error
|
|
|
document.location.href = '//www.yohobuy.com/reg.html?refer=' + refer;
|
|
|
document.location.href = '//www.yohobuy.com/signin.html?refer=' + refer;
|
|
|
return true;
|
|
|
} else if (d.code === 401) {
|
|
|
// token is error
|
|
|
$pwdErr.removeClass('hide').find('em').text(d.message);
|
|
|
return true;
|
|
|
}
|
|
|
|
...
|
...
|
|