Authored by 李靖

localStorage

... ... @@ -129,6 +129,7 @@ class Login {
}, true);
}
validate && validate.type === 2 && validate.refresh();
data.code = 4189;
if (data.code === 200) {
res = data.data;
... ... @@ -136,8 +137,8 @@ class Login {
location.href = res.href;
this.view.loginBtn.text('登录成功');
} else if (data.code === 4189) {
localStorage.loginJumpUrl = $('#account').val();
localStorage.loginJump = 'true';
window.setCookie('loginJumpUrl', $('input[name=username]').val(), {path: '/passport'});
window.setCookie('loginJump', true);
location.href = data.url;
} else if (data.code === 510) {
location.href = data.url;
... ...
... ... @@ -97,8 +97,8 @@ function loginAuth(params, acc) {
location.href = res.href;
$loginBtn.text('登录成功');
} else if (data.code === 4189) {
localStorage.loginJumpUrl = $('#account').val();
localStorage.loginJump = 'true';
window.setCookie('loginJumpUrl', $('input[name=username]').val(), {path: '/passport'});
window.setCookie('loginJump', true);
location.href = data.url;
} else if (data.code === 510) {
location.href = data.url;
... ...
... ... @@ -176,8 +176,8 @@ $(function() {
});
// 多次登录失败跳短信认证填充手机号
if (localStorage.loginJump) {
if (window.cookie('loginJump')) {
$('.sms-login .title').text('身份验证');
$('.sms-login-msg').before('<p class="sms-login-msg">您的账号存在安全隐患需要进行身份验证</p>');
localStorage.removeItem('loginJump');
window.setCookie('loginJump', '');
}
... ...
... ... @@ -149,5 +149,5 @@ $(function() {
});
// 多次登录失败跳短信认证填充手机号
$('#phone-num').val(localStorage.loginJumpUrl);
localStorage.removeItem('loginJumpUrl');
$('#phone-num').val(window.cookie('loginJumpUrl'));
window.setCookie('loginJumpUrl', '', {path: '/passport'});
... ...
... ... @@ -42,8 +42,8 @@ class SmsLoginNew extends Page {
this.selector.getVerifyCodeBtn.data('oneClick', false);
// 多次登录失败跳短信认证填充手机号
this.selector.mobileInput.val(localStorage.loginJumpUrl);
localStorage.removeItem('loginJumpUrl');
this.selector.mobileInput.val(window.cookie('loginJumpUrl'));
window.setCookie('loginJumpUrl', '', {path: '/passport'});
}
/**
... ...