Authored by xuqi

login remember me.Review by:@xuqi

... ... @@ -36,7 +36,7 @@
<span id="login-btn" class="login-btn btn">登录</span>
</li>
<li class="other-opts">
<span class="remeber-me">
<span class="remember-me">
<i class="iconfont">&#xe613;</i>
记住登录状态
</span>
... ...
... ... @@ -25,6 +25,8 @@ var $emailAutoComplete = $('#email-autocomplete');
var mailPhoneRegx = require('./mail-phone-regx');
var $remember = $('.remember-me');
//checkbox status unicode
var checkbox = {
checked: '&#xe612;',
... ... @@ -232,7 +234,7 @@ $emailAutoComplete.on('click', 'li', function() {
});
//记住登录状态
$('.remeber-me').on('click', function() {
$remember.on('click', function() {
var $this = $(this);
$this.toggleClass('checked');
... ... @@ -266,15 +268,19 @@ $('#login-btn').on('click', function() {
data: {
areaCode: $countryCodeHide.val().replace('+', ''),
account: $.trim($account.val()),
password: $.trim($password.val())
password: $.trim($password.val()),
isRemember: $remember.hasClass('checked') ? true : false
},
success: function(data) {
if (data.code === 400) {
if (data.code === 200) {
if (data.data) {
//防止data.data为undefined时下行语句执行出错而导致脚本不能走到complete去处理authing
location.href = data.data.href;
}
} else {
$passwordTip.removeClass('hide').children('em').text(data.message);
$password.addClass('error');
return;
} else {
location.href = data.data.href;
}
},
complete: function() {
... ...
... ... @@ -60,7 +60,7 @@ $third: sprite-map("passport/third/*.png");
}
}
.remeber-me {
.remember-me {
cursor: pointer;
}
... ...