<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
   <title>系统登陆</title>
<link href="<%=path%>/cdjs/themes/icon.css" rel="stylesheet" type="text/css" />
<link href="<%=path%>/cdjs/themes/default/easyui.css" rel="stylesheet" type="text/css" />
<script src="<%=path%>/cdjs/jquery-1.4.4.min.js" type="text/javascript"></script>
<script src="<%=path%>/cdjs/jquery.easyui.min.js" type="text/javascript"></script>
<script src="<%=path%>/cdjs/Cookie.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
	$("#loginWindow").window({
				title: '登录',
				width: 290,
				height: 180,
				modal: true,
				shadow: false,
				closable: false,
				maximizable: false,
				minimizable: false,
				collapsible: false,
				resizable: false
	});
	$("#btnLogin").click(function() {
	var username = document.getElementById("username").value;
	var password = document.getElementById("password").value;
	loginSys(username, password);
	});
	$("#aboutSys").click(function() {
	$.messager.alert('关于', '网上查车', 'info');
	});
	});
	//登陆操作
	function loginSys(username,password) {
	$.ajax({
	type: "POST",
	dataType: "json",
	//cache:true,
	url: "login/loginAction_login.action",
	data: { userName: username, userPass: password },
	success: function(json) {
		
		if (json.flag==true) {


			 alert("登录成功");
		      //window.location.href = "Index.aspx";
		}
		else {
		     $.messager.alert('错误', json.msg, 'error');
		}
	},
	error: function() {
	       $.messager.alert('错误', '获取账号信息失败...请联系管理员!', 'error');
	}
	});
	}
</script>
</head>
<body>
<div id="loginWindow" class="easyui-window" title="登陆窗口" iconCls="icon-login" style="width:300px;height:180px;padding:5px;background: #fafafa;">
<div border="false" style=" padding-left:30px; background:#fff;border:1px solid #ccc;">
<form>
<table>
<tr>
<td>用户名：</td>
<td><input id="username" style="width: 150px;" /></td>
</tr>
<tr>
<td>密码：</td>
<td><input type="password" id="password" style="width: 150px;" /></td>
</tr>
</table>
</form>
</div>
<div border="false" style="text-align:center;height:30px;line-height:30px; margin-top:6px;">
<a class="easyui-linkbutton" iconCls="icon-thereof" href="javascript:void(0)" id="aboutSys">关于</a>
<a class="easyui-linkbutton" iconCls="icon-ok" href="javascript:void(0)" id="btnLogin">登录</a>
</div>
</div>
</body>
</html> 
