<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<% 
	if(session.getAttribute("currentUser") != null ){
		response.sendRedirect("toIndex.do");
	}
%>
<html>
<head>
	<%@ include file="/include/header.jsp"%>
	<link type="text/css" rel="stylesheet" href="${ctx}/css/login.css" />
</head>
<body>
	<div class="login">
			<div class="loginP">
				<p>
					<img src="${ctx}/images/indexNew/logo.png" width="100" style="float: left;">
			        <b style="float: left;margin-left: 10px;">打假通</b>
				</p>
			</div>
			<div class="loginInput" style="clear: both;">
				<input type="hidden" id="csrfToken" value="${csrfToken}"/>
				<p><i class="icon1 userIcon"></i><input type="text" class="form-control text"  placeholder="请输入用户名" id="user"/></p>
				<p><i class="icon1 pwdIcon"></i><input type="password" class="form-control password" placeholder="请输入密码" id="pwd"/></p>
				<p><input type="button" class="form-control btn" id="btn" value="登录" ></p>
			</div>
		</div>
	<script>
		$(function(){
			$("#btn").bind("click",function(){
				$.post("${ctx}/login/login.do",{
					username:$("#user").val(),
					password:$("#pwd").val(),
					csrfToken:$("#csrfToken").val()
				},function(data){
					if(data=="succ"){
						document.location.replace("${ctx}");
					}
				});
			});
		});
	</script>
</body>
</html>
