<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1;charset=UTF-8">
<title>登录</title>
<link rel="stylesheet" type="text/css" href="${request.contextPath}/static/css/newcss.css">
<link rel="stylesheet" type="text/css" href="${request.contextPath}/static/css/login.css">
<#include "/common/commonJs.ftl">
</head>
<body>
<div class="login_top"><img src="${request.contextPath}/static/img/login_logo.jpg">
</div>
<div class="login_main">
<div class="login_main_1280 clearfix">
<div class="word_block">
<p class="word_block_p1" >登录</p>
<p class="word_block_p2" >登录。</p>
</div>
<div class="login_block">
<div class="login_block_title">用户登录 / User login</div>
<div class="login_block_line">
<img src="${request.contextPath}/static/img/login_user.png">
<input type="text" class="login_block_line_input" id="account" name="usercode" placeholder="请输入用户名" />
</div>
<div class="login_block_line">
<img src="${request.contextPath}/static/img/login_password.png">
<input type="password" class="login_block_line_input" onpaste="return false" oncontextmenu="return false"
oncopy="return false" oncut="return false" id="pwd" name="userpwd" placeholder="请输入密码" />
</div>
<span class="error"></span>
<div class="login_block_button">登 录</div>
</div>
</div>
</div>
<div class="login_bottom">Copyright © 2015 © 杭州百世伽信息科技有限公司 All Rights Reserved. Powered by Fainro</div>
</body>
<script type="text/javascript">
$("input[name='usercode']").keydown(function (event) {
if (event.keyCode == 32) {
return false;
}
});
$("input[name='userpwd']").keydown(function (event) {
if (event.keyCode == 32) {
return false;
}
});
$(".login_block_button").click(function () {
var dbUser = jQuery("input[name=usercode]").val().replace(/\s/g, "");
if (!dbUser) {
jQuery(".error").html("* 用户名不能为空");
return false;
} else {
jQuery("input[name=usercode]").val(dbUser);
}
var password = jQuery("input[name=userpwd]").val().replace(/\s/g, "");
if (!password) {
jQuery(".error").html("* 密码不能为空");
return false;
} else {
jQuery("input[name=userpwd]").val(password);
}
doLogin(dbUser, password);
});
$(document).keydown(function (event) {
if (event.keyCode == 13) {
jQuery(".login_block_button").trigger("click");
}
});
function showTips() {
jQuery(".error").html("* 请联系管理员!");
}
function doLogin(dbUser, password) {
jQuery.ajax({
url: "dologin",
type: "POST",
cache: false,
async: false,
data: {
"usercode": dbUser,
"userpwd": password
},
dataType: "json",
success: function (data, text) {
if (data.data.flag == 0) {
jQuery(".error").html("*该账号不存在,请检查");
} else if (data.data.flag == 1) {
jQuery(".error").html("*密码错误,请重新输入");
} else if (data.data.flag == 2) {
jQuery(".error").html("*该账号无登录权限");
} else if (data.data.flag == 3) {
window.location.href = "index";
} else if (data.data.flag == 4) {
jQuery(".error").html("*该账号已停用,请联系管理员");
}
}
})
}
$(function(){
login.initPage();
});
var login = {
initPage : function() {
if(window.top != window.self){
top.location.href = location.href;
}
},
}
</script>
</html>