QCLogin.jsp
1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<%@ 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>
<head>
<base href="<%=basePath%>">
<title>My JSP 'QCLogin.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<!--
<link rel="stylesheet" type="text/css" href="styles_wev8.css">
-->
<script type="text/javascript" src="/express/js/jquery-1.8.3.min_wev8.js"></script>
<style type="text/css">
* {
font-family: '微软雅黑';
}
</style>
<script type="text/javascript">
var loginInterval = null;
$(function () {
loginInterval = window.setInterval(function () {
getloginstatus("<%=session.getId() %>");
}, 1000);
});
function getloginstatus(key) {
jQuery.ajax({
url: "/QCLoginStatus.jsp?loginkey=" + key + "&rdm=" + new Date().getTime(),
dataType: "text",
contentType : "charset=UTF-8",
error:function(ajaxrequest){},
success:function(content){
window.console.log(jQuery.trim(content));
if (jQuery.trim(content) != '0') {
window.console.log("Successful user login!");
window.clearInterval(loginInterval);
window.location.href = jQuery.trim(content);
}
}
});
}
</script>
</head>
<body>
<table width="300px" cellpadding="5" cellspacing="0" align="top" style="border:1px solid #666666;">
<colgroup>
<col width="30%">
<col width="*">
</colgroup>
<tr>
<td colspan="2" align="center">
<h1>QC登录</h1>
请扫描登录
</td>
</tr>
<tr>
<td colspan="2" align="center">
<div><%=session.getId() %></div>
</td>
</tr>
</table>
</body>
</html>