<%@ page language="java" 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">
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=375,user-scalable=no">
<!-- <meta http-equiv="X-UA-Compatible" content="ie=edge"> -->
<link rel="stylesheet" href="css/common.css">
<link rel="stylesheet" href="css/result.css">
<script src="js/jquery-3.0.0.js"></script>
<script src="js/common.js"></script>
<title>登录</title>
</head>
<body>
<!-- 成功图片 -->
<div class="main">
用户名<input type="text" id="idCard"></input>
密码<input type="password" id="password"></input>
<button type="button" onclick="login();">确定</button>
</div>
<span id='div1'>把要打印的内容放这里</span>
<p>所有内容</p>
<div id="div2">div2的内容</div>
<a href="javascrīpt:;" target="_self" onclick="printme()">打印</a>
</body>
<!-- <script language="javascrīpt"> -->
<script type="text/javascript">
function printme()
{
document.body.innerHTML=document.getElementById('div1').innerHTML+'<br/>'+document.getElementById('div2').innerHTML;
window.print();
}
</script>
<script type="text/javascript">
function login() {
var idCard=$.trim($("#idCard").val());
var password=$.trim($("#password").val());
alert("身份证"+idCard+"密码"+password);
$.ajax({
url: "${ctx}/login/shiro-login",
dataType: "json",
type: "post",
data: {
idCard: idCard,
password: password
},
success: function (result) {
alert(result);
if(result==1){
window.location.href="pc-edu/index.jsp";
}
}
});
}
</script>
</html>