mirror of https://gitee.com/zhang_1334717033/kiftd
update to v1.0.28-release
parent
23ef3fd95c
commit
5ba01aaebc
Binary file not shown.
|
|
@ -542,13 +542,15 @@ function startLogin(){
|
||||||
$("#accountid").attr('disabled','disabled');
|
$("#accountid").attr('disabled','disabled');
|
||||||
$("#accountpwd").attr('disabled','disabled');
|
$("#accountpwd").attr('disabled','disabled');
|
||||||
$("#dologinButton").attr('disabled','disabled');
|
$("#dologinButton").attr('disabled','disabled');
|
||||||
|
$("#vercode").attr('disabled','disabled');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 结束登陆加载动画
|
// 结束登陆加载动画
|
||||||
function finishLogin(){
|
function finishLogin(){
|
||||||
$("#accountid").removeAttr('disabled','disabled');
|
$("#accountid").removeAttr('disabled');
|
||||||
$("#accountpwd").removeAttr('disabled','disabled');
|
$("#accountpwd").removeAttr('disabled');
|
||||||
$("#dologinButton").removeAttr('disabled','disabled');
|
$("#dologinButton").removeAttr('disabled');
|
||||||
|
$("#vercode").removeAttr('disabled');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 登录操作
|
// 登录操作
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -52,6 +52,7 @@ function dologin() {
|
||||||
$("#accountpwdbox").removeClass("has-error");
|
$("#accountpwdbox").removeClass("has-error");
|
||||||
}
|
}
|
||||||
if (check == "y") {
|
if (check == "y") {
|
||||||
|
startLogin();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type : "POST",
|
type : "POST",
|
||||||
dataType : "text",
|
dataType : "text",
|
||||||
|
|
@ -67,9 +68,7 @@ function dologin() {
|
||||||
sendLoginInfo(encrypted);
|
sendLoginInfo(encrypted);
|
||||||
},
|
},
|
||||||
error : function() {
|
error : function() {
|
||||||
$("#alertbox").addClass("alert");
|
showAlert("提示:登录请求失败,请检查网络或服务器运行状态");
|
||||||
$("#alertbox").addClass("alert-danger");
|
|
||||||
$("#alertbox").text("提示:登录请求失败,请检查网络或服务器运行状态");
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -93,6 +92,7 @@ function sendLoginInfo(encrypted) {
|
||||||
$("#vercodebox").addClass("hidden");
|
$("#vercodebox").addClass("hidden");
|
||||||
switch (result) {
|
switch (result) {
|
||||||
case "permitlogin":
|
case "permitlogin":
|
||||||
|
finishLogin();
|
||||||
$("#accountidbox").removeClass("has-error");
|
$("#accountidbox").removeClass("has-error");
|
||||||
$("#accountpwdbox").removeClass("has-error");
|
$("#accountpwdbox").removeClass("has-error");
|
||||||
window.location.href = "/home.html";
|
window.location.href = "/home.html";
|
||||||
|
|
@ -100,38 +100,29 @@ function sendLoginInfo(encrypted) {
|
||||||
case "accountnotfound":
|
case "accountnotfound":
|
||||||
$("#accountidbox").addClass("has-error");
|
$("#accountidbox").addClass("has-error");
|
||||||
$("#accountpwdbox").removeClass("has-error");
|
$("#accountpwdbox").removeClass("has-error");
|
||||||
$("#alertbox").addClass("alert");
|
showAlert("提示:登录失败,账户不存在或未设置");
|
||||||
$("#alertbox").addClass("alert-danger");
|
|
||||||
$("#alertbox").text("提示:登录失败,账户不存在或未设置");
|
|
||||||
break;
|
break;
|
||||||
case "accountpwderror":
|
case "accountpwderror":
|
||||||
$("#accountpwdbox").addClass("has-error");
|
$("#accountpwdbox").addClass("has-error");
|
||||||
$("#accountidbox").removeClass("has-error");
|
$("#accountidbox").removeClass("has-error");
|
||||||
$("#alertbox").addClass("alert");
|
showAlert("提示:登录失败,密码错误或未设置");
|
||||||
$("#alertbox").addClass("alert-danger");
|
|
||||||
$("#alertbox").text("提示:登录失败,密码错误或未设置");
|
|
||||||
break;
|
break;
|
||||||
case "needsubmitvercode":
|
case "needsubmitvercode":
|
||||||
|
finishLogin();
|
||||||
$("#vercodebox").html("<label id='vercodetitle' class='col-sm-6'><img id='showvercode' class='vercodeimg' alt='点击获取验证码' src='homeController/getNewVerCode.do?s="+(new Date()).getTime()+"' onclick='getNewVerCode()'></label><div class='col-sm-6'><input type='text' class='form-control' id='vercode' placeholder='验证码……'></div>");
|
$("#vercodebox").html("<label id='vercodetitle' class='col-sm-6'><img id='showvercode' class='vercodeimg' alt='点击获取验证码' src='homeController/getNewVerCode.do?s="+(new Date()).getTime()+"' onclick='getNewVerCode()'></label><div class='col-sm-6'><input type='text' class='form-control' id='vercode' placeholder='验证码……'></div>");
|
||||||
$("#vercodebox").removeClass("hidden");
|
$("#vercodebox").removeClass("hidden");
|
||||||
$("#vercodebox").addClass("show");
|
$("#vercodebox").addClass("show");
|
||||||
break;
|
break;
|
||||||
case "error":
|
case "error":
|
||||||
$("#alertbox").addClass("alert");
|
showAlert("提示:登录失败,登录请求无法通过效验(可能是请求耗时过长导致的)");
|
||||||
$("#alertbox").addClass("alert-danger");
|
|
||||||
$("#alertbox").text("提示:登录失败,登录请求无法通过效验(可能是请求耗时过长导致的)");
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$("#alertbox").addClass("alert");
|
showAlert("提示:无法登录,未知错误");
|
||||||
$("#alertbox").addClass("alert-danger");
|
|
||||||
$("#alertbox").text("提示:无法登录,未知错误");
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error : function() {
|
error : function() {
|
||||||
$("#alertbox").addClass("alert");
|
showAlert("提示:登录请求失败,请检查网络或服务器运行状态");
|
||||||
$("#alertbox").addClass("alert-danger");
|
|
||||||
$("#alertbox").text("提示:登录请求失败,请检查网络或服务器运行状态");
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -140,3 +131,26 @@ function sendLoginInfo(encrypted) {
|
||||||
function getNewVerCode(){
|
function getNewVerCode(){
|
||||||
$("#showvercode").attr("src","homeController/getNewVerCode.do?s="+(new Date()).getTime());
|
$("#showvercode").attr("src","homeController/getNewVerCode.do?s="+(new Date()).getTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function showAlert(text){
|
||||||
|
finishLogin();
|
||||||
|
$("#alertbox").addClass("alert");
|
||||||
|
$("#alertbox").addClass("alert-danger");
|
||||||
|
$("#alertbox").text(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
function startLogin(){
|
||||||
|
$("#loginBtn").attr('disabled','disabled');
|
||||||
|
$("#accountid").attr('disabled','disabled');
|
||||||
|
$("#accountpwd").attr('disabled','disabled');
|
||||||
|
$("#vercode").attr('disabled','disabled');
|
||||||
|
$("#loginBtn").val('正在登录...');
|
||||||
|
}
|
||||||
|
|
||||||
|
function finishLogin(){
|
||||||
|
$("#loginBtn").removeAttr('disabled');
|
||||||
|
$("#accountid").removeAttr('disabled');
|
||||||
|
$("#accountpwd").removeAttr('disabled');
|
||||||
|
$("#vercode").removeAttr('disabled');
|
||||||
|
$("#loginBtn").val('登录');
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue