同步判断结果码,增加记住密码选项

This commit is contained in:
shuzheng 2017-02-24 00:05:51 +08:00
parent d7336264b5
commit 0a9e4a2587
1 changed files with 9 additions and 16 deletions

View File

@ -37,7 +37,7 @@
</div>
<div class="checkbox">
<label>
<input id="rememberme" type="checkbox" name="rememberme">
<input id="rememberMe" type="checkbox" name="rememberMe">
<i class="input-helper"></i>
自动登录
</label>
@ -70,30 +70,23 @@
data: {
username: $('#username').val(),
password: $('#password').val(),
rememberme: $('#rememberme').val(),
rememberMe: $('#rememberMe').is(':checked'),
backurl: '${param.backurl}'
},
beforeSend: function() {
},
success: function(json){
if (json.result) {
if (json.code == 1) {
location.href = json.data;
} else {
if (10001 == json.data) {
alert("帐号不能为空!");
alert(json.data);
if (10101 == json.code) {
$('#username').focus();
}
if (10002 == json.data) {
alert("密码不能为空!");
if (10102 == json.code) {
$('#password').focus();
}
if (10004 == json.data) {
alert("该帐号不存在!");
}
if (10005 == json.data) {
alert("密码错误!");
}
if (10006 == json.data) {
alert("帐号被封!");
}
}
},
error: function(error){