<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
	<head>
		<meta charset="UTF-8"/>
		<title>工作流</title>
	</head>
	<body>
		<div>
			<span>登录</span>
			<input id="username" placeholder="用户名" /><br />
			<button onclick="login()">提交</button>
		</div>
	</body>
</html>

<style>
* {
	font-family: "微软雅黑";
	font-size: 15px;
	margin: 0 auto;
}
div{
	width: 400px;
	margin-top:100px;
	text-align:center;
	padding-top:10px;
}
input,button{
	margin-top:10px;
}
input{
	width: 400px;
	padding: 5px 3px;
	border: 1px solid #ccc;
	border-radius: 4px;
}

button {
	padding:5px 0;
	width: 408px;
}
</style>

<script src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
<script>
	function login(){
		$.ajax({
			url : "/login",
			type: "POST",
			data : {
				"username" : $("#username").val()
			},
			success : function(data) {
			    console.log(data)
				if(data.code == 200){
					if(data.info.type == 1){
						location.href="/home";
					}else if(data.info.type == 2){
						location.href="/homeApprover";
					}else if(data.info.type == 3){
                        location.href="/homeApproverHr";
					}else{
                        location.href="/homeApproverzjl";
					}
				}else{
					alert(data.msg);
				}
			}
		});
	}
</script>