$(function() {
	layer.open({
		type: 1,
		shade: false,
		title: "管理员登录",
		closeBtn: false,
		area: ['450px', '350px'], //宽高
		content: $('#windowDiv')
	});
})

function login() {
	showLoad();
	$.ajax({
		type: 'POST',
		url: ctx + 'loginExample/login',
		data: $("#loginForm").serialize(),
		dataType: 'json',
		success: function(data) {
			closeLoad();
			if (data.success) {
				location.href = ctx + "adminPage/example";
			} else {
				layer.msg(data.msg);
			}

		},
		error: function() {
			closeLoad();
			layer.alert("请求失败，请刷新重试");
		}
	});

}

function getKey() {
	if (event.keyCode == 13) {
		login();
	}
}

